-
-
Notifications
You must be signed in to change notification settings - Fork 55
fix: false positive with no-rename-default #157
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
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c6d13c4 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 |
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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #157 +/- ##
==========================================
- Coverage 96.22% 96.00% -0.22%
==========================================
Files 91 101 +10
Lines 4399 4661 +262
Branches 1497 1595 +98
==========================================
+ Hits 4233 4475 +242
- Misses 160 180 +20
Partials 6 6 ☔ View full report in Codecov by Sentry. |
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.
Ideally I want to put this change on hold. The problem is more than _default
or index
. There is also mangled exports. See also #136
|
@SukkaW It looks like the discussion has died down on #136. Can we merge this for now in order to make this rule slightly more sane? If not:
|
WalkthroughAdds a changeset for a patch release and updates the no-rename-default ESLint rule to early-return when a default export’s name (after trimming leading underscores) equals "default" or "index", preventing reporting in these cases. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as ESLint Runner
participant Rule as no-rename-default Rule
participant AST as AST Node
Dev->>Rule: Evaluate ExportDefaultDeclaration
Rule->>AST: Read default export name
Rule->>Rule: Trim leading underscores
alt Name is "default" or "index"
Note over Rule: New early-return guard
Rule-->>Dev: No report
else Other names
Rule->>Rule: Proceed with existing import handling
alt Violation detected
Rule-->>Dev: Report problem
else No issue
Rule-->>Dev: No report
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
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. Comment |
commit: |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/young-pants-warn.md
(1 hunks)src/rules/no-rename-default.ts
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/rules/no-rename-default.ts (1)
src/export-map.ts (4)
n
(443-625)hasDefault
(674-676)hasDeep
(727-778)specifier
(339-357)
.changeset/young-pants-warn.md (1)
test/cli.spec.ts (1)
eslint
(13-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
- 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 20 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 18 and ESLint 9 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 24.5 and ESLint 9 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 24.5 and ESLint 8.56 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 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 20 and ESLint 8 on ubuntu-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 9 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 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on macos-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on macos-latest
- GitHub Check: Lint and Test with Node.js 20 and ESLint 9 on macos-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)
.changeset/young-pants-warn.md (1)
1-5
: LGTM!The changeset correctly documents a patch release for the false positive fix.
This PR fixes the false positive with the package "typescript-eslint" and "eslint-plugin-jsdoc".
Summary by CodeRabbit
Bug Fixes
Chores