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

chore: enable @typescript-eslint/explicit-module-boundary-types #8372

Merged
merged 2 commits into from
May 28, 2022

Conversation

sosukesuzuki
Copy link
Contributor

Description

This PR does not touch the logic, only fixes types.

Additional context

Looking at .eslintrc, I noticed that @typescript-eslint/explicit-module-boundary-types was previously enabled in this repository.

It used to be included in typescript-eslint's recommended rules, but has been removed since v5.

Maybe forgot to enable it manually at that time.

This PR re-enables @typescript-eslint/explicit-module-boundary-types and fixes errors.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added the p1-chore Doesn't change code behavior (priority) label May 28, 2022
@patak-dev patak-dev merged commit 104caf9 into vitejs:main May 28, 2022
@IanVS
Copy link
Contributor

IanVS commented May 31, 2022

I find that manually typing functions can often result in more generic or looser types than what TypeScript can infer on its own. Is that what is intended here? Or are the types here simple enough that this didn't happen?

@Shinigami92
Copy link
Member

I find that manually typing functions can often result in more generic or looser types than what TypeScript can infer on its own. Is that what is intended here? Or are the types here simple enough that this didn't happen?

  1. yes I assume in 99.9% of the cases it is simple enough
  2. if not, you can eslint-disable next line on demand
  3. even then, you can try to write exactly what TypeScript tries to infer
  4. it strength the API, note that this is only enforced for explicit boundaries or in other words export ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants