Skip to content

fix(eslint-plugin): [no-useless-default-assignment] reduce param index to ts this handling#11949

Merged
JoshuaKGoldberg merged 2 commits intotypescript-eslint:mainfrom
chrros95:fix-11948
Feb 2, 2026
Merged

fix(eslint-plugin): [no-useless-default-assignment] reduce param index to ts this handling#11949
JoshuaKGoldberg merged 2 commits intotypescript-eslint:mainfrom
chrros95:fix-11948

Conversation

@chrros95
Copy link
Copy Markdown
Contributor

@chrros95 chrros95 commented Jan 10, 2026

PR Checklist

Overview

The es tree node has the this parameter in the signature param list, while the ts nodes have an explicit param for that.
So if the thisParameter is detected, the paramIndex is reduced to reflect this difference.

The es tree node has the this parm in the signature while the ts nodes have explicit param for that.
@typescript-eslint
Copy link
Copy Markdown
Contributor

Thanks for the PR, @chrros95!

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
Copy Markdown

netlify bot commented Jan 10, 2026

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit e28434e
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/6980d5f61b61ca0008643563
😎 Deploy Preview https://deploy-preview-11949--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: 92 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 90 (🔴 down 2 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
Copy Markdown

nx-cloud bot commented Jan 10, 2026

View your CI Pipeline Execution ↗ for commit e28434e

Command Status Duration Result
nx run types:build ✅ Succeeded 1s View ↗
nx run-many --target=build --parallel --exclude... ✅ Succeeded 11s View ↗
nx test eslint-plugin ✅ Succeeded 4s View ↗
nx test project-service ✅ Succeeded 1s View ↗
nx test rule-tester ✅ Succeeded 2s View ↗
nx test tsconfig-utils ✅ Succeeded <1s View ↗
nx test parser ✅ Succeeded 3s View ↗
nx test typescript-estree ✅ Succeeded 1s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-02-03 00:51:21 UTC

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.73%. Comparing base (d1ddeb0) to head (e3e87d0).
⚠️ Report is 8 commits behind head on main.

⚠️ Current head e3e87d0 differs from pull request most recent head e28434e

Please upload reports for the commit e28434e to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11949      +/-   ##
==========================================
- Coverage   90.80%   90.73%   -0.08%     
==========================================
  Files         531      527       -4     
  Lines       54637    53681     -956     
  Branches     9228     9027     -201     
==========================================
- Hits        49611    48705     -906     
+ Misses       5015     4963      -52     
- Partials       11       13       +2     
Flag Coverage Δ
unittest 90.73% <100.00%> (-0.08%) ⬇️

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.63% <100.00%> (-0.01%) ⬇️

... and 29 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.

@chrros95 chrros95 marked this pull request as ready for review January 25, 2026 08:51
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changes Feb 2, 2026
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 🙌

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Feb 2, 2026
@JoshuaKGoldberg JoshuaKGoldberg merged commit 8a95834 into typescript-eslint:main Feb 2, 2026
7 checks passed
@chrros95 chrros95 deleted the fix-11948 branch February 7, 2026 18:08
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Feb 10, 2026
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.54.0 | 8.55.0 |
| npm        | @typescript-eslint/parser        | 8.54.0 | 8.55.0 |


## [v8.55.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8550-2026-02-09)

##### 🚀 Features

- **utils:** deprecate defaultOptions in favor of meta.defaultOptions ([#11992](typescript-eslint/typescript-eslint#11992))

##### 🩹 Fixes

- **eslint-plugin:** \[no-useless-default-assignment] reduce param index to ts this handling ([#11949](typescript-eslint/typescript-eslint#11949))
- **eslint-plugin:** \[no-useless-default-assignment] report unnecessary defaults in ternary expressions ([#11984](typescript-eslint/typescript-eslint#11984))
- **eslint-plugin:** \[no-useless-default-assignment] require strictNullChecks ([#11966](typescript-eslint/typescript-eslint#11966), [#12000](typescript-eslint/typescript-eslint#12000))
- **eslint-plugin:** \[no-unused-vars] remove trailing newline when removing entire import ([#11990](typescript-eslint/typescript-eslint#11990))

##### ❤️ Thank You

- Christian Rose [@chrros95](https://github.com/chrros95)
- Josh Goldberg
- Maria Solano [@MariaSolOs](https://github.com/MariaSolOs)
- Minyeong Kim [@minyeong981](https://github.com/minyeong981)
- SungHyun627 [@SungHyun627](https://github.com/SungHyun627)
- Yukihiro Hasegawa [@y-hsgw](https://github.com/y-hsgw)

See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.55.0) for more information.

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Feb 10, 2026
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.54.0 | 8.55.0 |
| npm        | @typescript-eslint/parser        | 8.54.0 | 8.55.0 |


## [v8.55.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8550-2026-02-09)

##### 🚀 Features

- **utils:** deprecate defaultOptions in favor of meta.defaultOptions ([#11992](typescript-eslint/typescript-eslint#11992))

##### 🩹 Fixes

- **eslint-plugin:** \[no-useless-default-assignment] reduce param index to ts this handling ([#11949](typescript-eslint/typescript-eslint#11949))
- **eslint-plugin:** \[no-useless-default-assignment] report unnecessary defaults in ternary expressions ([#11984](typescript-eslint/typescript-eslint#11984))
- **eslint-plugin:** \[no-useless-default-assignment] require strictNullChecks ([#11966](typescript-eslint/typescript-eslint#11966), [#12000](typescript-eslint/typescript-eslint#12000))
- **eslint-plugin:** \[no-unused-vars] remove trailing newline when removing entire import ([#11990](typescript-eslint/typescript-eslint#11990))

##### ❤️ Thank You

- Christian Rose [@chrros95](https://github.com/chrros95)
- Josh Goldberg
- Maria Solano [@MariaSolOs](https://github.com/MariaSolOs)
- Minyeong Kim [@minyeong981](https://github.com/minyeong981)
- SungHyun627 [@SungHyun627](https://github.com/SungHyun627)
- Yukihiro Hasegawa [@y-hsgw](https://github.com/y-hsgw)

See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.55.0) for more information.

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Feb 11, 2026
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.54.0 | 8.55.0 |
| npm        | @typescript-eslint/parser        | 8.54.0 | 8.55.0 |


## [v8.55.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8550-2026-02-09)

##### 🚀 Features

- **utils:** deprecate defaultOptions in favor of meta.defaultOptions ([#11992](typescript-eslint/typescript-eslint#11992))

##### 🩹 Fixes

- **eslint-plugin:** \[no-useless-default-assignment] reduce param index to ts this handling ([#11949](typescript-eslint/typescript-eslint#11949))
- **eslint-plugin:** \[no-useless-default-assignment] report unnecessary defaults in ternary expressions ([#11984](typescript-eslint/typescript-eslint#11984))
- **eslint-plugin:** \[no-useless-default-assignment] require strictNullChecks ([#11966](typescript-eslint/typescript-eslint#11966), [#12000](typescript-eslint/typescript-eslint#12000))
- **eslint-plugin:** \[no-unused-vars] remove trailing newline when removing entire import ([#11990](typescript-eslint/typescript-eslint#11990))

##### ❤️ Thank You

- Christian Rose [@chrros95](https://github.com/chrros95)
- Josh Goldberg
- Maria Solano [@MariaSolOs](https://github.com/MariaSolOs)
- Minyeong Kim [@minyeong981](https://github.com/minyeong981)
- SungHyun627 [@SungHyun627](https://github.com/SungHyun627)
- Yukihiro Hasegawa [@y-hsgw](https://github.com/y-hsgw)

See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.55.0) for more information.

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

Development

Successfully merging this pull request may close these issues.

Bug: [@typescript-eslint/no-useless-default-assignment] TypeError when using this parameter and a default for an attribute of an object parameter

2 participants