Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): fix crash and false positives inno-useless-default-assignment#11845

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ulrichstark wants to merge10 commits intotypescript-eslint:main
base:main
Choose a base branch
Loading
fromulrichstark:fix(eslint-plugin)--fix-crash-in-`no-useless-default-assignment`-if-no-signatures

Conversation

@ulrichstark
Copy link
Contributor

@ulrichstarkulrichstark commentedDec 15, 2025
edited by JoshuaKGoldberg
Loading

PR Checklist

Overview

The rule now treats types as ifisNoUncheckedIndexedAccess 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)

simPod, JoshuaKGoldberg, and brokentone reacted with hooray emojireduckted and JoshuaKGoldberg reacted with heart emojijerone reacted with rocket emoji
@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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedDec 15, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitf25f541
🔍 Latest deploy loghttps://app.netlify.com/projects/typescript-eslint/deploys/6944f9946baf6600083ac8d5
😎 Deploy Previewhttps://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: 97 (🟢 up 18 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 yourNetlify project configuration.

@nx-cloud
Copy link

nx-cloudbot commentedDec 15, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commitf25f541

CommandStatusDurationResult
nx test eslint-plugin --coverage=false✅ Succeeded5m 13sView ↗
nx run-many -t lint✅ Succeeded3m 22sView ↗
nx run-many -t typecheck✅ Succeeded2m 11sView ↗
nx run integration-tests:test✅ Succeeded5sView ↗
nx test typescript-estree --coverage=false✅ Succeeded1sView ↗
nx test eslint-plugin-internal --coverage=false✅ Succeeded3sView ↗
nx run types:build✅ Succeeded2sView ↗
nx run generate-configs✅ Succeeded6sView ↗
Additional runs (29)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-12-19 07:18:30 UTC

@codecov
Copy link

codecovbot commentedDec 15, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (c62e858) to head (f25f541).
⚠️ Report is 3 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
FlagCoverage Δ
unittest90.58% <100.00%> (+<0.01%)⬆️

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

Files with missing linesCoverage Δ
...-plugin/src/rules/no-useless-default-assignment.ts99.54% <100.00%> (-0.46%)⬇️

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

@ulrichstarkulrichstark changed the titlefix(eslint-plugin): fix crash inno-useless-default-assignment if no signaturesfix(eslint-plugin): fix crash and false positives inno-useless-default-assignmentDec 16, 2025
@brokentone
Copy link

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

ulrichstark reacted with thumbs up emoji

Copy link
Member

@kirkwaiblingerkirkwaiblinger 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.

JoshuaKGoldberg reacted with thumbs up emoji
@ulrichstark
Copy link
ContributorAuthor

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.

kirkwaiblinger reacted with thumbs up emoji

kirkwaiblinger
kirkwaiblinger previously approved these changesDec 17, 2025
Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Seems good!

ulrichstark reacted with rocket emoji
`,
`
declare const tuple: [string];
const [a, b = 'default'] = tuple;

Choose a reason for hiding this comment

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

(praise) TIL that TS allows out-of-bounds tuple destructuring if a default value is present.

Comically it means that

const[a,outOfBounds=undefined]=["foo"]asconst;

iskind of a false positive if you really squint, but I think let's completely ignore that edge case as niche and unimportant.

ulrichstark and JoshuaKGoldberg reacted with thumbs up emoji
@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelDec 17, 2025
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesDec 19, 2025
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

🚀 Thanks!

ulrichstark reacted with rocket emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@kirkwaiblingerkirkwaiblingerkirkwaiblinger left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge

Projects

None yet

Milestone

No milestone

4 participants

@ulrichstark@brokentone@JoshuaKGoldberg@kirkwaiblinger

[8]ページ先頭

©2009-2025 Movatter.jp