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: add explicit-module-boundary-types lint rule #9539

Merged
merged 1 commit into from Feb 9, 2020

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Feb 8, 2020

Summary

I've found that type errors can be quite hard to understand when there are many layers of inference between the actual source of the type error and where it shows up as an actual type error. By typing all exported functions within a single file, any type error should at least have its origin within one file, instead of having to dig though multiple layers.

Rule docs: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md

One annoying thing is that it doesn't recognise any as a type, which is somewhat painful in certain circumstances (like for matchers in expect)

Test plan

Green CI

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

That's a lot of typings :o but sounds good. This is something that Flow started to do recently, but mostly for perf reasons I think

@codecov-io
Copy link

Codecov Report

Merging #9539 into master will increase coverage by 0.02%.
The diff coverage is 88.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9539      +/-   ##
==========================================
+ Coverage   65.03%   65.05%   +0.02%     
==========================================
  Files         283      283              
  Lines       12113    12120       +7     
  Branches     3000     3004       +4     
==========================================
+ Hits         7878     7885       +7     
  Misses       3597     3597              
  Partials      638      638
Impacted Files Coverage Δ
packages/jest-watcher/src/PatternPrompt.ts 0% <ø> (ø) ⬆️
packages/jest-util/src/createDirectory.ts 0% <ø> (ø) ⬆️
...ges/jest-core/src/getNoTestFoundPassWithNoTests.ts 100% <ø> (ø) ⬆️
...es/jest-watcher/src/lib/formatTestNameByPattern.ts 84.21% <ø> (ø) ⬆️
packages/babel-plugin-jest-hoist/src/index.ts 0% <ø> (ø) ⬆️
packages/jest-jasmine2/src/jasmineAsyncInstall.ts 0% <ø> (ø) ⬆️
...ages/jest-worker/src/workers/ChildProcessWorker.ts 90% <ø> (ø) ⬆️
packages/jest-runner/src/testWorker.ts 0% <ø> (ø) ⬆️
packages/pretty-format/src/collections.ts 98.48% <ø> (ø) ⬆️
packages/jest-jasmine2/src/reporter.ts 59.52% <ø> (ø) ⬆️
... and 96 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 481077b...92199bb. Read the comment docs.

@SimenB SimenB merged commit 5d1e98b into jestjs:master Feb 9, 2020
@SimenB SimenB deleted the eslint-explicit-module-boundary-types branch February 9, 2020 21:41
@SimenB
Copy link
Member Author

SimenB commented Feb 9, 2020

Found a bug with this rule, so will need another pass when that's fixed 😅 typescript-eslint/typescript-eslint#1583

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants