Skip to content

Commit a0de751

Browse files
committed
feat: update eslint
1 parent 45c2651 commit a0de751

2 files changed

Lines changed: 18 additions & 48 deletions

File tree

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ module.exports = {
7474
'{}': false
7575
}
7676
}
77-
]
77+
],
78+
'@typescript-eslint/no-namespace': 'off'
7879
},
7980
settings: {
8081
'import/resolver': {

src/codegen/src/helpers.ts

Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//@ts-nocheck
22
/**
3-
* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3
4-
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
5-
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
6-
*/
7-
3+
* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3
4+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
5+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
6+
*/
87

98
declare var self: any | undefined;
109
declare var window: any | undefined;
@@ -18,8 +17,7 @@ var globalThis: any = (() => {
1817
})();
1918

2019
const atob: (b64: string) => string =
21-
globalThis.atob ||
22-
((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
20+
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
2321

2422
export function bytesFromBase64(b64: string): Uint8Array {
2523
const bin = atob(b64);
@@ -31,8 +29,7 @@ export function bytesFromBase64(b64: string): Uint8Array {
3129
}
3230

3331
const btoa: (bin: string) => string =
34-
globalThis.btoa ||
35-
((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
32+
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
3633

3734
export function base64FromBytes(arr: Uint8Array): string {
3835
const bin: string[] = [];
@@ -47,9 +44,7 @@ export interface AminoHeight {
4744
readonly revision_height?: string;
4845
}
4946

50-
export function omitDefault<T extends string | number | bigint | boolean>(
51-
input: T
52-
): T | undefined {
47+
export function omitDefault<T extends string | number | bigint | boolean>(input: T): T | undefined {
5348
if (typeof input === 'string') {
5449
return input === '' ? undefined : input;
5550
}
@@ -58,8 +53,8 @@ export function omitDefault<T extends string | number | bigint | boolean>(
5853
return input === 0 ? undefined : input;
5954
}
6055

61-
if (typeof input === "boolean"){
62-
return input === false ? undefined : input;
56+
if (typeof input === 'boolean') {
57+
return input === false ? undefined : input;
6358
}
6459

6560
if (typeof input === 'bigint') {
@@ -96,10 +91,7 @@ export function toDuration(duration: string): Duration {
9691
}
9792

9893
export function fromDuration(duration: Duration): string {
99-
return (
100-
parseInt(duration.seconds.toString()) * 1000000000 +
101-
duration.nanos
102-
).toString();
94+
return (parseInt(duration.seconds.toString()) * 1000000000 + duration.nanos).toString();
10395
}
10496

10597
export function isSet(value: any): boolean {
@@ -130,10 +122,7 @@ export interface Params {
130122
params: PageRequestParams;
131123
}
132124

133-
export const setPaginationParams = (
134-
options: Params,
135-
pagination?: PageRequest
136-
) => {
125+
export const setPaginationParams = (options: Params, pagination?: PageRequest) => {
137126
if (!pagination) {
138127
return options;
139128
}
@@ -146,9 +135,7 @@ export const setPaginationParams = (
146135
// let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
147136

148137
// Uint8Array to String
149-
options.params['pagination.key'] = Buffer.from(pagination.key).toString(
150-
'base64'
151-
);
138+
options.params['pagination.key'] = Buffer.from(pagination.key).toString('base64');
152139
}
153140
if (typeof pagination?.limit !== 'undefined') {
154141
options.params['pagination.limit'] = pagination.limit.toString();
@@ -163,15 +150,7 @@ export const setPaginationParams = (
163150
return options;
164151
};
165152

166-
type Builtin =
167-
| Date
168-
| Function
169-
| Uint8Array
170-
| string
171-
| number
172-
| bigint
173-
| boolean
174-
| undefined;
153+
type Builtin = Date | Uint8Array | string | number | bigint | boolean | undefined;
175154

176155
export type DeepPartial<T> = T extends Builtin
177156
? T
@@ -186,17 +165,10 @@ export type DeepPartial<T> = T extends Builtin
186165
type KeysOfUnion<T> = T extends T ? keyof T : never;
187166
export type Exact<P, I extends P> = P extends Builtin
188167
? P
189-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<
190-
Exclude<keyof I, KeysOfUnion<P>>,
191-
never
192-
>;
168+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
193169

194170
export interface Rpc {
195-
request(
196-
service: string,
197-
method: string,
198-
data: Uint8Array
199-
): Promise<Uint8Array>;
171+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
200172
}
201173

202174
interface Timestamp {
@@ -233,9 +205,7 @@ export function fromTimestamp(t: Timestamp): Date {
233205

234206
const timestampFromJSON = (object: any): Timestamp => {
235207
return {
236-
seconds: isSet(object.seconds)
237-
? BigInt(object.seconds.toString())
238-
: BigInt(0),
208+
seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0),
239209
nanos: isSet(object.nanos) ? Number(object.nanos) : 0
240210
};
241211
};
@@ -253,4 +223,3 @@ export function fromJsonTimestamp(o: any): Timestamp {
253223
function numberToLong(number: number) {
254224
return BigInt(Math.trunc(number));
255225
}
256-

0 commit comments

Comments
 (0)