Skip to content

Commit

Permalink
Merge pull request #23 from FastLane-Labs/fix/test-ts-warnings
Browse files Browse the repository at this point in the history
chore: remove ts warnings
  • Loading branch information
0x1NotMe authored Oct 8, 2024
2 parents f364b1e + 31b8291 commit f521c68
Show file tree
Hide file tree
Showing 19 changed files with 244 additions and 227 deletions.
54 changes: 19 additions & 35 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"@typescript-eslint/no-explicit-any": "off"
}
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"prettier/prettier": "error"
}
}
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 2
}
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "dist/index.js",
"scripts": {
"test": "jest",
"build": "tsc"
"build": "tsc",
"prettier": "prettier --write .",
"prettier:check": "prettier --check ."
},
"repository": {
"type": "git",
Expand All @@ -23,6 +25,7 @@
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0",
"prettier": "^3.3.3",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
Expand Down
34 changes: 17 additions & 17 deletions src/backend/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export interface IBackend {
submitUserOperation(
userOp: UserOperation,
hints: string[],
extra?: any
extra?: any,
): Promise<string>;

_submitUserOperation(
userOp: UserOperation,
hints: string[],
extra?: any
extra?: any,
): Promise<string>;

/**
Expand All @@ -37,14 +37,14 @@ export interface IBackend {
userOp: UserOperation,
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<SolverOperation[]>;

_getSolverOperations(
userOp: UserOperation,
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<SolverOperation[]>;

/**
Expand All @@ -69,13 +69,13 @@ export interface IBackend {
getBundleHash(
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<string>;

_getBundleHash(
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<string>;
}

Expand All @@ -91,13 +91,13 @@ export abstract class BaseBackend implements IBackend {
async submitUserOperation(
userOp: UserOperation,
hints: string[],
extra?: any
extra?: any,
): Promise<string> {
// Pre hooks
for (const hooksController of this.hooksControllers) {
[userOp, hints] = await hooksController.preSubmitUserOperation(
userOp,
hints
hints,
);
}

Expand All @@ -108,7 +108,7 @@ export abstract class BaseBackend implements IBackend {
for (const hooksController of this.hooksControllers) {
[userOp, userOpHash] = await hooksController.postSubmitUserOperation(
userOp,
userOpHash
userOpHash,
);
}

Expand All @@ -119,13 +119,13 @@ export abstract class BaseBackend implements IBackend {
userOp: UserOperation,
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<SolverOperation[]> {
// Pre hooks
for (const hooksController of this.hooksControllers) {
[userOp, userOpHash] = await hooksController.preGetSolverOperations(
userOp,
userOpHash
userOpHash,
);
}

Expand All @@ -134,14 +134,14 @@ export abstract class BaseBackend implements IBackend {
userOp,
userOpHash,
wait,
extra
extra,
);

// Post hooks
for (const hooksController of this.hooksControllers) {
[userOp, solverOps] = await hooksController.postGetSolverOperations(
userOp,
solverOps
solverOps,
);
}

Expand All @@ -168,7 +168,7 @@ export abstract class BaseBackend implements IBackend {
async getBundleHash(
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<string> {
// Pre hooks
for (const hooksController of this.hooksControllers) {
Expand All @@ -189,7 +189,7 @@ export abstract class BaseBackend implements IBackend {
async _submitUserOperation(
userOp: UserOperation,
hints: string[],
extra?: any
extra?: any,
): Promise<string> {
throw new Error("Method not implemented.");
}
Expand All @@ -198,7 +198,7 @@ export abstract class BaseBackend implements IBackend {
userOp: UserOperation,
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<SolverOperation[]> {
throw new Error("Method not implemented.");
}
Expand All @@ -210,7 +210,7 @@ export abstract class BaseBackend implements IBackend {
async _getBundleHash(
userOpHash: string,
wait?: boolean,
extra?: any
extra?: any,
): Promise<string> {
throw new Error("Method not implemented.");
}
Expand Down
Loading

0 comments on commit f521c68

Please sign in to comment.