Skip to content

feat(eslint-plugin): [explicit-module-boundary-types] add an option to ignore overload implementations #10889

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ronami
Copy link
Member

@ronami ronami commented Feb 25, 2025

PR Checklist

Overview

This PR addresses #4586 and add an option to ignore overload implementations:

export function test(a: string): string;
export function test(a: number): number;
export function test(a: unknown) {
  return a;
}

Some thoughts:

Would it make sense to apply the same option to explicit-function-return-type too?

It seems both rules share several options (e.g. allowHigherOrderFunctions, allowDirectConstAssertionInArrowFunctions, allowTypedFunctionExpressions) and also have common code for handling these options.

I think the motivation for having this option in explicit-function-return-type is the same for explicit-module-boundary-types.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @ronami!

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.

Copy link

netlify bot commented Feb 25, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit ae67ef7
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/67c4e3b2d3b7020008cfcc20
😎 Deploy Preview https://deploy-preview-10889--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 6 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (🟢 up 8 from production)
SEO: 98 (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 site configuration.

Copy link

nx-cloud bot commented Feb 25, 2025

View your CI Pipeline Execution ↗ for commit 9d01f4e.

Command Status Duration Result
nx run-many --target=build --exclude website --... ✅ Succeeded 7s View ↗
nx run-many --target=clean ✅ Succeeded 10s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-25 22:26:59 UTC

@ronami ronami marked this pull request as ready for review February 25, 2025 22:27
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.44%. Comparing base (c910ac1) to head (ae67ef7).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10889      +/-   ##
==========================================
+ Coverage   87.27%   87.44%   +0.16%     
==========================================
  Files         453      468      +15     
  Lines       15833    16046     +213     
  Branches     4639     4653      +14     
==========================================
+ Hits        13819    14031     +212     
  Misses       1658     1658              
- Partials      356      357       +1     
Flag Coverage Δ
unittest 87.44% <100.00%> (+0.16%) ⬆️

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

Files with missing lines Coverage Δ
...plugin/src/rules/explicit-module-boundary-types.ts 89.78% <100.00%> (+0.46%) ⬆️

... and 19 files with indirect coverage changes

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.

LGTM, nice and clean! Just one thing on docs? 🧹

@ronami ronami requested a review from JoshuaKGoldberg March 2, 2025 23:17
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.

Conan O'Brien dancing side-to-side

@JoshuaKGoldberg JoshuaKGoldberg merged commit 84af50e into typescript-eslint:main Mar 3, 2025
59 checks passed
@ronami ronami deleted the explicit-module-boundary-types-ignore-overload-implementation branch March 3, 2025 20:22
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 5, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.24.0 | 8.26.0 |
| npm        | @typescript-eslint/parser        | 8.24.0 | 8.26.0 |


## [v8.26.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8260-2025-03-03)

##### 🚀 Features

-   **eslint-plugin:** \[unified-signatures] support ignoring overload signatures with different JSDoc comments ([#10781](typescript-eslint/typescript-eslint#10781))
-   **eslint-plugin:** \[explicit-module-boundary-types] add an option to ignore overload implementations ([#10889](typescript-eslint/typescript-eslint#10889))
-   **eslint-plugin:** \[no-unused-var] handle implicit exports in declaration files ([#10714](typescript-eslint/typescript-eslint#10714))
-   support TypeScript 5.8 ([#10903](typescript-eslint/typescript-eslint#10903))
-   **eslint-plugin:** \[no-unnecessary-type-parameters] special case tuples and parameter location arrays as single-use ([#9536](typescript-eslint/typescript-eslint#9536))

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unnecessary-type-assertion] handle unknown ([#10875](typescript-eslint/typescript-eslint#10875))
-   **eslint-plugin:** \[no-invalid-void-type] report `accessor` properties with an invalid `void` type ([#10864](typescript-eslint/typescript-eslint#10864))
-   **eslint-plugin:** \[unified-signatures] does not differentiate truly private methods ([#10806](typescript-eslint/typescript-eslint#10806))

##### ❤️ Thank You

-   Andrea Simone Costa [@jfet97](https://github.com/jfet97)
-   Dirk Luijk [@dirkluijk](https://github.com/dirkluijk)
-   Ronen Amiel
-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)
-   Yukihiro Hasegawa [@y-hsgw](https://github.com/y-hsgw)

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.


## [v8.25.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8250-2025-02-24)

##### 🚀 Features

-   **eslint-plugin:** \[no-misused-spread] add suggestions ([#10719](typescript-eslint/typescript-eslint#10719))

##### 🩹 Fixes

-   **eslint-plugin:** \[prefer-nullish-coalescing] report on chain expressions in a ternary ([#10708](typescript-eslint/typescript-eslint#10708))
-   **eslint-plugin:** \[no-deprecated] report usage of deprecated private identifiers ([#10844](typescript-eslint/typescript-eslint#10844))
-   **eslint-plugin:** \[unified-signatures] handle getter-setter ([#10818](typescript-eslint/typescript-eslint#10818))

##### ❤️ Thank You

-   Olivier Zalmanski [@OlivierZal](https://github.com/OlivierZal)
-   Ronen Amiel
-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.


## [v8.24.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8241-2025-02-17)

##### 🩹 Fixes

-   **eslint-plugin:** \[class-methods-use-this] check `accessor` methods with a function initializer ([#10796](typescript-eslint/typescript-eslint#10796))
-   **eslint-plugin:** \[no-misused-promises] don't report on `static` `accessor` properties ([#10814](typescript-eslint/typescript-eslint#10814))
-   **eslint-plugin:** \[no-deprecated] don't report on deprecated `accessor` property declaration ([#10813](typescript-eslint/typescript-eslint#10813))
-   **eslint-plugin:** \[explicit-member-accessibility] check `accessor` class properties for missing accessibility modifier ([#10805](typescript-eslint/typescript-eslint#10805))
-   **eslint-plugin:** \[explicit-module-boundary-types] check `accessor` class properties with a function initializer ([#10804](typescript-eslint/typescript-eslint#10804))
-   **eslint-plugin:** \[prefer-return-this-type] check `accessor` properties with a function initializer ([#10794](typescript-eslint/typescript-eslint#10794))
-   **eslint-plugin:** \[consistent-generic-constructors] check `accessor` class properties ([#10789](typescript-eslint/typescript-eslint#10789))
-   **eslint-plugin:** \[no-unsafe-assignment] report on an `any` value assigned as an initializer of an `accessor` property ([#10785](typescript-eslint/typescript-eslint#10785))
-   **eslint-plugin:** \[no-unnecessary-template-expression] ignore enum and enum members ([#10782](typescript-eslint/typescript-eslint#10782))
-   **eslint-plugin:** \[no-inferrable-types] handle accessor ([#10780](typescript-eslint/typescript-eslint#10780))

##### ❤️ Thank You

-   Ronen Amiel
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explicit-module-boundary-types] New option to allow unspecified return type if there are overload signatures
2 participants