Skip to content

Conversation

@ulrichstark
Copy link
Contributor

@ulrichstark ulrichstark commented Dec 15, 2025

PR Checklist

Overview

The rule now treats types as if isNoUncheckedIndexedAccess is enabled to not report false positives and suggest unsafe fixes. This required me to move some test cases from the "invalid" section to the "valid" section. Also added reproduction test cases for every issue this PR fixes.

Fixes #11846 (3 false positives)
Fixes #11849 (1 crash)

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @ulrichstark!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 84419df
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/6942737110e17a000815b8e8
😎 Deploy Preview https://deploy-preview-11845--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🟢 up 17 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link

nx-cloud bot commented Dec 15, 2025

View your CI Pipeline Execution ↗ for commit 84419df

Command Status Duration Result
nx test eslint-plugin --coverage=false ✅ Succeeded 5m 30s View ↗
nx run-many -t lint ✅ Succeeded 3m 12s View ↗
nx run-many -t typecheck ✅ Succeeded 1m 53s View ↗
nx test typescript-estree --coverage=false ✅ Succeeded 2s View ↗
nx run generate-configs ✅ Succeeded 8s View ↗
nx run types:build ✅ Succeeded 2s View ↗
nx run integration-tests:test ✅ Succeeded 5s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded 3s View ↗
Additional runs (29) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-12-17 09:22:32 UTC

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (c62e858) to head (84419df).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11845   +/-   ##
=======================================
  Coverage   90.58%   90.58%           
=======================================
  Files         524      524           
  Lines       53324    53409   +85     
  Branches     8892     8917   +25     
=======================================
+ Hits        48301    48383   +82     
- Misses       5010     5013    +3     
  Partials       13       13           
Flag Coverage Δ
unittest 90.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...-plugin/src/rules/no-useless-default-assignment.ts 99.54% <100.00%> (-0.46%) ⬇️

... and 3 files with indirect coverage changes

🚀 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.

@ulrichstark ulrichstark changed the title fix(eslint-plugin): fix crash in no-useless-default-assignment if no signatures fix(eslint-plugin): fix crash and false positives in no-useless-default-assignment Dec 16, 2025
@brokentone
Copy link

I pulled this fork, built, and yarn link'd locally on a project that is crashing on the current release and it now succeeds.

Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this generally looks good, at least for the fixes for #11846 and #11849...

I'll note, though, that it seems like 3 independent, non-overlapping fixes. Usually we'd prefer to have one PR per issue for things that aren't highly coupled, since it simplifies our work as reviewers and also makes it easier to revert if there's a big problem with one of the fixes (not likely in this case). In any case, one of the issues is not accepting PRs yet, so we can't proceed with this PR in its current form quite yet.

Would you be willing to break this apart into the independent fixes? 🙏 That would expedite being able to get the fixes for #11846 and #11849 completed.

@ulrichstark
Copy link
Contributor Author

Thanks @kirkwaiblinger for the review! I removed the changes for #11847 and brought back the noUncheckedIndexedAccess tests. This PR now only closes #11846 and #11849.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants