Skip to content
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

📎 Implement nursery/useExplicitTypes - typescript-eslint/explicit-module-boundary-types and typescript-eslint/explicit-function-return-type #2017

Open
Conaclos opened this issue Mar 9, 2024 · 8 comments
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Comments

@Conaclos
Copy link
Member

Conaclos commented Mar 9, 2024

Description

The rule will cover:

This rule must not conflict with noInferrableTypes.

Some context here.

@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 9, 2024
@Conaclos Conaclos self-assigned this Mar 9, 2024
@polar-sh polar-sh bot added the Fund label Mar 9, 2024
@Conaclos Conaclos changed the title 📎 Implement lint/useExplicitTypes - typescript-eslint/explicit-module-boundary-types and typescript-eslint/explicit-function-return-type 📎 Implement nursery/useExplicitTypes - typescript-eslint/explicit-module-boundary-types and typescript-eslint/explicit-function-return-type Mar 14, 2024
@polar-sh polar-sh bot removed the Fund label Apr 19, 2024
@barthuygen
Copy link

This is exactly the what I'm missing, is there any prospect on when this might be implemented?

@ematipico
Copy link
Member

ematipico commented Jun 5, 2024

@barthuygen

We refrain from giving dates, deadlines and such because we aren't a company and we develop things using the small resources we have.

If you're willing to see this shipped "faster" than the others, you can always help us financially: https://github.com/biomejs/biome/blob/main/GOVERNANCE.md#financial-contributions

Or willing to implement the feature yourself.

@dreamorosi
Copy link

Hi @ematipico - about the sponsorship:

  • what would be an appropriate amount of sponsorship that would secure the implementation?
  • once sponsored, what would be the estimated timeline for the feature to land in a biome version?

I can't commit to it yet, but having a discrete amount and timeline would definitely help me make a case.

@ematipico
Copy link
Member

@dreamorosi I believe we document everything inside our governance document. I suggest to reach out to us in #funding

@dreamorosi
Copy link

Hi @ematipico thanks for the reply - None of the links to Discord in the Governance document worked for me, maybe the invite link has expired. I was able to join through another link in the Contributing doc.

@RayanMoarkech
Copy link

+1 for explicit-function-return-type

@firxworx
Copy link

firxworx commented Jul 5, 2024

No kidding the explicit-function-return-type rule is the singlemost important blocker from me not ditching eslint entirely for biomejs... that plus better monorepo support but I know that's in the works. I tried biome and it is amazingly fast and nice.

Importance

TypeScript runs better and faster with explicit return types especially in large codebases, and its been known to make unexpected random performance issues disappear.

Stylistically I love it, it brings the rigour of strong-typed languages like java and makes code much easier to review and test when every function signature is a declaration of the "data in + data out" and an explicit statement of the developer's intent.

I've even watched it prevent bugs in React components during pair sessions (where this rule is sometimes accused of being annoying) e.g. if a component may conditionally return null that has to be part of the return type in addition to JSX.Element.

Suggestions

I understand the first priority is getting this rule in.

IMHO to take it to another level would be to have some more customization capabilities for it beyond what eslint provides and perhaps a "lever or knob" to control it for trivial arrow functions.

Perhaps dreaming now: a level of React awareness would be fantastic e.g. as I don't think cleanup callbacks and the like (always void) need to be declared. While I appreciate it, others would love to turn it off for React component files e.g. tsx but keep it for ts.

Perhaps to pull some of the dream requirements off as a general feature there could be a way to configure with custom patterns/regexes.

@kaykdm
Copy link
Contributor

kaykdm commented Sep 21, 2024

I have implemented the base cases of typescript-eslint/explicit-function-return-type rule. Here are the remaining TODOs, as discussed in the PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

No branches or pull requests

7 participants