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

Fix TypeScript Lints #137

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Fix TypeScript Lints #137

merged 2 commits into from
Nov 7, 2023

Conversation

nlordell
Copy link
Collaborator

@nlordell nlordell commented Nov 7, 2023

This PR just fixes some TypeScript lints. Additional comments included inline 👇.

@nlordell nlordell requested a review from a team as a code owner November 7, 2023 13:55
@nlordell nlordell requested review from rmeissner, akshay-ap and mmv08 and removed request for a team November 7, 2023 13:55
@@ -88,6 +88,7 @@ const actionCalldata = (action: MetaTransaction): string => {
}

export interface RpcProvider extends Provider {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
send(method: string, params: unknown[]): Promise<any>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the interface of a JsonRpcProvider in ethers, so I just disabled the lint for the send function.

@coveralls
Copy link

coveralls commented Nov 7, 2023

Pull Request Test Coverage Report for Build 6787408863

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 6785684479: 0.0%
Covered Lines: 27
Relevant Lines: 27

💛 - Coveralls

@@ -98,6 +99,7 @@ export class MultiProvider4337 extends JsonRpcProvider {
this.generalProvider = generalProvider
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Copy link
Member

Choose a reason for hiding this comment

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

Any is just a warning, right? Is it necessary to turn it off, or keeping it as a "todo" list is better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In this case, I don't think it is a TODO lint - as this is the function signature required by ethers, so it will always be the any and the lint is a false-positive.

That being said, I do agree with "keeping it as a "todo" list is better", so at least for the eslint-disable-next-line @typescript-eslint/no-non-null-assertion it would make sense to keep the lint warning around...

4337/test/e2e/ReferenceEntryPoint.spec.ts Outdated Show resolved Hide resolved
@nlordell
Copy link
Collaborator Author

nlordell commented Nov 7, 2023

@mmv08 can you take another look? I augmented the ethers module to fix some of the typing issues I ran into.

@mmv08
Copy link
Member

mmv08 commented Nov 7, 2023

@mmv08 can you take another look? I augmented the ethers module to fix some of the typing issues I ran into.

In general, it looks good to me. I don't know how reliable overwriting ethers' types is in case there are any breaking changes. But anyway, if there are any, they should be caught by tests.

@nlordell nlordell merged commit fb8eba4 into master Nov 7, 2023
@nlordell nlordell deleted the fix-ts-lints branch November 7, 2023 17:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants