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

refactor: replace any with unknown, enable noImplicitAny #76

Merged
merged 1 commit into from
May 6, 2020

Conversation

raveclassic
Copy link
Contributor

@raveclassic raveclassic commented Apr 20, 2020

Hi!
First, thanks for this lib, I've spent quite a lot of time searching for something similar to hareactive and now looks like I have what I need, thanks!

In the meantime, while I'm wrapping my head around the actual implementation, I'd like to contribute to type-safety of the code.

So, in this PR I

  • tried to remove any type annotations and casts as any as much as possible. I failed in some places because couldn't get how they work :)
  • enabled noImplicitAny and made corresponding changes to the code

Although all changes in this PR are cosmetical and the logic isn't changed, there may be some breaking changes due to using more strict unknown type instead of any in some public API.

@codecov
Copy link

codecov bot commented Apr 20, 2020

Codecov Report

Merging #76 into master will increase coverage by 0.02%.
The diff coverage is 97.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
+ Coverage   96.19%   96.22%   +0.02%     
==========================================
  Files          13       13              
  Lines        1499     1508       +9     
  Branches      135      136       +1     
==========================================
+ Hits         1442     1451       +9     
  Misses         57       57              
Impacted Files Coverage Δ
src/placeholder.ts 91.13% <83.33%> (ø)
src/behavior.ts 98.28% <100.00%> (ø)
src/common.ts 97.64% <100.00%> (+0.02%) ⬆️
src/datastructures.ts 100.00% <100.00%> (ø)
src/dom.ts 86.53% <100.00%> (ø)
src/future.ts 96.45% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/now.ts 92.43% <100.00%> (+0.12%) ⬆️
src/stream.ts 95.68% <100.00%> (ø)
src/testing.ts 96.75% <100.00%> (+0.09%) ⬆️
... and 1 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 b222e34...353dd83. Read the comment docs.

@raveclassic raveclassic force-pushed the replace-any-with-unknown branch from b3e3414 to 353dd83 Compare April 20, 2020 14:48
@limemloh
Copy link
Member

limemloh commented May 6, 2020

Thank you for showing interest and your contribution.

Feel free to open an issue and ask about any of the implementation details.
The implementation is not the simplest and prettiest, but most of this is because of performance.

@limemloh limemloh merged commit d37fd70 into funkia:master May 6, 2020
@raveclassic raveclassic deleted the replace-any-with-unknown branch May 9, 2020 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants