Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fisker
Copy link
Contributor

@fisker fisker commented Sep 28, 2025

PR Checklist

Overview

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @fisker!

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 Sep 28, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit c30d11d
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/68dac51c1c7f4d000885cb4c
😎 Deploy Preview https://deploy-preview-11657--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: 89 (🟢 up 6 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 Sep 28, 2025

View your CI Pipeline Execution ↗ for commit c30d11d

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

☁️ Nx Cloud last updated this comment at 2025-09-29 17:49:21 UTC

@fisker fisker force-pushed the class-abstract-method branch from fcd0b87 to 4230204 Compare September 28, 2025 15:08
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.90%. Comparing base (967764e) to head (c30d11d).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
packages/typescript-estree/src/convert.ts 0.00% 11 Missing ⚠️
packages/typescript-estree/src/node-utils.ts 14.28% 6 Missing ⚠️

❌ Your patch status has failed because the patch coverage (5.55%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11657      +/-   ##
==========================================
- Coverage   90.93%   90.90%   -0.03%     
==========================================
  Files         506      506              
  Lines       51400    51414      +14     
  Branches     8484     8483       -1     
==========================================
- Hits        46741    46739       -2     
- Misses       4646     4662      +16     
  Partials       13       13              
Flag Coverage Δ
unittest 90.90% <5.55%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
packages/typescript-estree/src/node-utils.ts 62.50% <14.28%> (-0.55%) ⬇️
packages/typescript-estree/src/convert.ts 30.16% <0.00%> (-0.07%) ⬇️

... and 1 file 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.

@fisker fisker force-pushed the class-abstract-method branch from 2d59c8f to 1d5e23c Compare September 29, 2025 16:42
@fisker fisker changed the title fix(typescript-estree): forbid abstract method to have implementation fix(typescript-estree): forbid abstract method and accessor to have implementation Sep 29, 2025
@fisker fisker marked this pull request as draft September 29, 2025 16:56
@fisker fisker marked this pull request as ready for review September 29, 2025 17:42
@fisker fisker force-pushed the class-abstract-method branch from e6587ff to c30d11d Compare September 29, 2025 17:42
Copy link
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.

Fantastic - very clean and thorough. Nice!

Just requesting the one (Missing) case be tested or removed. Otherwise this looks ready to go to me.

Copy link
Member

Choose a reason for hiding this comment

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

[Praise] Nice, always happy to see this file cleaned up.

ast: ts.SourceFile,
): string {
const text = ast.text.slice(name.pos, name.end).trimStart();
return text || '(Missing)';
Copy link
Member

Choose a reason for hiding this comment

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

'(Missing)'

[Testing] This doesn't show up in any of the snapshots. Can you either add a test showing it (if it's possible?) or remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This original declarationNameToString from typescript package have this, so I guess it's possible, but I don't know how to test.

Copy link
Member

Choose a reason for hiding this comment

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

👍 makes sense, I think it's reasonable to leave in then. Thanks.

node.kind === SyntaxKind.GetAccessor ||
node.kind === SyntaxKind.SetAccessor
? 'An abstract accessor cannot have an implementation.'
: `Method '${declarationNameToString(node.name, this.ast)}' cannot have an implementation because it is marked abstract.`,
Copy link
Member

Choose a reason for hiding this comment

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

[Praise] These are great error messages! 👏

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Oct 3, 2025
@JoshuaKGoldberg JoshuaKGoldberg merged commit 02e0278 into typescript-eslint:main Oct 6, 2025
64 of 66 checks passed
@fisker fisker deleted the class-abstract-method branch October 6, 2025 14:10
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 8, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.45.0 | 8.46.0 |
| npm        | @typescript-eslint/parser        | 8.45.0 | 8.46.0 |


## [v8.46.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8460-2025-10-06)

##### 🚀 Features

- **eslint-plugin:** \[no-unsafe-member-access] add allowOptionalChaining option ([#11659](typescript-eslint/typescript-eslint#11659))
- **rule-schema-to-typescript-types:** clean up and make public ([#11633](typescript-eslint/typescript-eslint#11633))

##### 🩹 Fixes

- **eslint-plugin:** \[prefer-readonly-parameter-types] ignore tagged primitives ([#11660](typescript-eslint/typescript-eslint#11660))
- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](typescript-eslint/typescript-eslint#11657))
- **eslint-plugin:** removed error type previously deprecated ([#11674](typescript-eslint/typescript-eslint#11674))
- **eslint-plugin:** \[no-deprecated] ignore deprecated `export import`s ([#11603](typescript-eslint/typescript-eslint#11603))
- **eslint-plugin:** \[unbound-method] improve wording around `this: void` and binding ([#11634](typescript-eslint/typescript-eslint#11634))
- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](typescript-eslint/typescript-eslint#11628))
- **eslint-plugin:** \[no-floating-promises] remove excess parentheses in suggestions ([#11487](typescript-eslint/typescript-eslint#11487))

##### ❤️ Thank You

- fisker Cheung [@fisker](https://github.com/fisker)
- Josh Goldberg ✨
- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- Mark de Dios [@peanutenthusiast](https://github.com/peanutenthusiast)
- Richard Torres [@richardtorres314](https://github.com/richardtorres314)
- Victor Genaev [@mainframev](https://github.com/mainframev)

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 Oct 8, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.45.0 | 8.46.0 |
| npm        | @typescript-eslint/parser        | 8.45.0 | 8.46.0 |


## [v8.46.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8460-2025-10-06)

##### 🚀 Features

- **eslint-plugin:** \[no-unsafe-member-access] add allowOptionalChaining option ([#11659](typescript-eslint/typescript-eslint#11659))
- **rule-schema-to-typescript-types:** clean up and make public ([#11633](typescript-eslint/typescript-eslint#11633))

##### 🩹 Fixes

- **eslint-plugin:** \[prefer-readonly-parameter-types] ignore tagged primitives ([#11660](typescript-eslint/typescript-eslint#11660))
- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](typescript-eslint/typescript-eslint#11657))
- **eslint-plugin:** removed error type previously deprecated ([#11674](typescript-eslint/typescript-eslint#11674))
- **eslint-plugin:** \[no-deprecated] ignore deprecated `export import`s ([#11603](typescript-eslint/typescript-eslint#11603))
- **eslint-plugin:** \[unbound-method] improve wording around `this: void` and binding ([#11634](typescript-eslint/typescript-eslint#11634))
- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](typescript-eslint/typescript-eslint#11628))
- **eslint-plugin:** \[no-floating-promises] remove excess parentheses in suggestions ([#11487](typescript-eslint/typescript-eslint#11487))

##### ❤️ Thank You

- fisker Cheung [@fisker](https://github.com/fisker)
- Josh Goldberg ✨
- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- Mark de Dios [@peanutenthusiast](https://github.com/peanutenthusiast)
- Richard Torres [@richardtorres314](https://github.com/richardtorres314)
- Victor Genaev [@mainframev](https://github.com/mainframev)

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

awaiting response Issues waiting for a reply from the OP or another party

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Forbid abstract accessor to have implementation Enhancement: Forbid abstract method to have implementation

2 participants