chore(eslint): enable no-useless-assignment rule#1055
Draft
carlosthe19916 wants to merge 5 commits into
Draft
Conversation
Remove initial values that are immediately overwritten in both branches of if/else blocks, using const + ternary or uninitialized let. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnables the ESLint File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In both
useVulnerabilitiesOfSbomimplementations,opinionatedAdvisoryandopinionatedScoreare now declared without initial values; double-check that all control-flow paths assign them before use, or initialize them tonullto avoid potential undefined usage at runtime.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In both `useVulnerabilitiesOfSbom` implementations, `opinionatedAdvisory` and `opinionatedScore` are now declared without initial values; double-check that all control-flow paths assign them before use, or initialize them to `null` to avoid potential undefined usage at runtime.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1055 +/- ##
==========================================
+ Coverage 50.68% 50.69% +0.01%
==========================================
Files 253 253
Lines 5499 5490 -9
Branches 1660 1659 -1
==========================================
- Hits 2787 2783 -4
+ Misses 2440 2436 -4
+ Partials 272 271 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
no-useless-assignmentoverride from ESLint configconst+ ternary or uninitializedletdeclarationsTest plan
npm run lintpasses with 0 warnings🤖 Generated with Claude Code
Summary by Sourcery
Enable the ESLint no-useless-assignment rule by removing its override and updating code to avoid unnecessary variable reassignments.
Enhancements:
Build: