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: disable unsafe any access #138

Merged
merged 6 commits into from
Mar 28, 2023

Conversation

IronLu233
Copy link
Contributor

@IronLu233 IronLu233 commented Mar 22, 2023

What Changed

Resolve #134 #138

add these ESlint rules. and disable some rules on unit test file.

  • '@typescript-eslint/no-implicit-any-catch
  • '@typescript-eslint/no-unsafe-argument
  • '@typescript-eslint/no-unsafe-assignment'
  • '@typescript-eslint/no-unsafe-call'
  • '@typescript-eslint/no-unsafe-member-access'
  • '@typescript-eslint/no-unsafe-return'

Motivation

In our system we have some unsafe access, because they are from 3rd party library. In this PR, unless the developer use as Type first, they can not access the prop in the object.

And for error catching, the developer must determine the error type, than can do the sequence thing.

Change Type

Indicate the type of change your pull request is:

  • documentation
  • internal
  • patch
  • minor
  • major

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Merging #138 (c482929) into main (922352e) will increase coverage by 0.16%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
+ Coverage   87.19%   87.36%   +0.16%     
==========================================
  Files          48       48              
  Lines         812      815       +3     
  Branches       97       97              
==========================================
+ Hits          708      712       +4     
+ Misses         21       20       -1     
  Partials       83       83              
Impacted Files Coverage Δ
...es/extension-chrome/src/services/storage/memory.ts 84.61% <50.00%> (+6.04%) ⬆️
...tension-chrome/src/messaging/contentAndInjected.ts 71.42% <100.00%> (ø)
packages/extension-chrome/src/messaging/session.ts 80.43% <100.00%> (ø)
...src/rpc/middlewares/parameterValidateMiddleware.ts 85.71% <100.00%> (ø)

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@IronLu233 IronLu233 marked this pull request as ready for review March 22, 2023 09:57
@IronLu233 IronLu233 requested a review from homura March 22, 2023 09:57
ecyktdduqli5069
ecyktdduqli5069 approved these changes Mar 22, 2023
@homura homura added the internal Changes only affect the internal API label Mar 23, 2023
@homura homura merged commit 66eac28 into ckb-js:main Mar 28, 2023
@github-actions
Copy link

🚀 PR was released in v0.0.5 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Changes only affect the internal API released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor code with no-unsafe-member-access
3 participants