-
Notifications
You must be signed in to change notification settings - Fork 207
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
Prettier 3.0 #8030
Prettier 3.0 #8030
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -506,15 +506,15 @@ interface Rpc { | |
data: Uint8Array, | ||
): Promise<Uint8Array>; | ||
} | ||
declare type Builtin = | ||
type Builtin = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ugh. this code is generated by some protobuf tool. next time we run that tool ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was generated by |
||
| Date | ||
| Function | ||
| Uint8Array | ||
| string | ||
| number | ||
| boolean | ||
| undefined; | ||
export declare type DeepPartial<T> = T extends Builtin | ||
export type DeepPartial<T> = T extends Builtin | ||
? T | ||
: T extends Long | ||
? string | number | Long | ||
|
@@ -527,8 +527,8 @@ export declare type DeepPartial<T> = T extends Builtin | |
[K in keyof T]?: DeepPartial<T[K]>; | ||
} | ||
: Partial<T>; | ||
declare type KeysOfUnion<T> = T extends T ? keyof T : never; | ||
export declare type Exact<P, I extends P> = P extends Builtin | ||
type KeysOfUnion<T> = T extends T ? keyof T : never; | ||
export type Exact<P, I extends P> = P extends Builtin | ||
? P | ||
: P & { | ||
[K in keyof P]: Exact<P[K], I[K]>; | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -64,10 +64,10 @@ export const MsgDeliverInbound = { | |||
fromJSON(object) { | ||||
return { | ||||
messages: Array.isArray(object?.messages) | ||||
? object.messages.map((e) => String(e)) | ||||
? object.messages.map(e => String(e)) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again, this is generated code. Any clues on why our lint tools didn't complain about it when it was originally merged? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the generated code after being prettiered ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused, are you saying the codegen steps already re-format generated code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes.
|
||||
: [], | ||||
nums: Array.isArray(object?.nums) | ||||
? object.nums.map((e) => Long.fromValue(e)) | ||||
? object.nums.map(e => Long.fromValue(e)) | ||||
: [], | ||||
ack: isSet(object.ack) ? Long.fromValue(object.ack) : Long.UZERO, | ||||
submitter: isSet(object.submitter) | ||||
|
@@ -78,12 +78,12 @@ export const MsgDeliverInbound = { | |||
toJSON(message) { | ||||
const obj = {}; | ||||
if (message.messages) { | ||||
obj.messages = message.messages.map((e) => e); | ||||
obj.messages = message.messages.map(e => e); | ||||
} else { | ||||
obj.messages = []; | ||||
} | ||||
if (message.nums) { | ||||
obj.nums = message.nums.map((e) => (e || Long.UZERO).toString()); | ||||
obj.nums = message.nums.map(e => (e || Long.UZERO).toString()); | ||||
} else { | ||||
obj.nums = []; | ||||
} | ||||
|
@@ -97,8 +97,8 @@ export const MsgDeliverInbound = { | |||
}, | ||||
fromPartial(object) { | ||||
const message = createBaseMsgDeliverInbound(); | ||||
message.messages = object.messages?.map((e) => e) || []; | ||||
message.nums = object.nums?.map((e) => Long.fromValue(e)) || []; | ||||
message.messages = object.messages?.map(e => e) || []; | ||||
message.nums = object.nums?.map(e => Long.fromValue(e)) || []; | ||||
message.ack = | ||||
object.ack !== undefined && object.ack !== null | ||||
? Long.fromValue(object.ack) | ||||
|
@@ -378,7 +378,7 @@ export const MsgProvision = { | |||
? bytesFromBase64(object.address) | ||||
: new Uint8Array(), | ||||
powerFlags: Array.isArray(object?.powerFlags) | ||||
? object.powerFlags.map((e) => String(e)) | ||||
? object.powerFlags.map(e => String(e)) | ||||
: [], | ||||
submitter: isSet(object.submitter) | ||||
? bytesFromBase64(object.submitter) | ||||
|
@@ -393,7 +393,7 @@ export const MsgProvision = { | |||
message.address !== undefined ? message.address : new Uint8Array(), | ||||
)); | ||||
if (message.powerFlags) { | ||||
obj.powerFlags = message.powerFlags.map((e) => e); | ||||
obj.powerFlags = message.powerFlags.map(e => e); | ||||
} else { | ||||
obj.powerFlags = []; | ||||
} | ||||
|
@@ -407,7 +407,7 @@ export const MsgProvision = { | |||
const message = createBaseMsgProvision(); | ||||
message.nickname = object.nickname ?? ''; | ||||
message.address = object.address ?? new Uint8Array(); | ||||
message.powerFlags = object.powerFlags?.map((e) => e) || []; | ||||
message.powerFlags = object.powerFlags?.map(e => e) || []; | ||||
message.submitter = object.submitter ?? new Uint8Array(); | ||||
return message; | ||||
}, | ||||
|
@@ -588,35 +588,35 @@ export class MsgClientImpl { | |||
InstallBundle(request) { | ||||
const data = MsgInstallBundle.encode(request).finish(); | ||||
const promise = this.rpc.request(this.service, 'InstallBundle', data); | ||||
return promise.then((data) => | ||||
return promise.then(data => | ||||
MsgInstallBundleResponse.decode(new _m0.Reader(data)), | ||||
); | ||||
} | ||||
DeliverInbound(request) { | ||||
const data = MsgDeliverInbound.encode(request).finish(); | ||||
const promise = this.rpc.request(this.service, 'DeliverInbound', data); | ||||
return promise.then((data) => | ||||
return promise.then(data => | ||||
MsgDeliverInboundResponse.decode(new _m0.Reader(data)), | ||||
); | ||||
} | ||||
WalletAction(request) { | ||||
const data = MsgWalletAction.encode(request).finish(); | ||||
const promise = this.rpc.request(this.service, 'WalletAction', data); | ||||
return promise.then((data) => | ||||
return promise.then(data => | ||||
MsgWalletActionResponse.decode(new _m0.Reader(data)), | ||||
); | ||||
} | ||||
WalletSpendAction(request) { | ||||
const data = MsgWalletSpendAction.encode(request).finish(); | ||||
const promise = this.rpc.request(this.service, 'WalletSpendAction', data); | ||||
return promise.then((data) => | ||||
return promise.then(data => | ||||
MsgWalletSpendActionResponse.decode(new _m0.Reader(data)), | ||||
); | ||||
} | ||||
Provision(request) { | ||||
const data = MsgProvision.encode(request).finish(); | ||||
const promise = this.rpc.request(this.service, 'Provision', data); | ||||
return promise.then((data) => | ||||
return promise.then(data => | ||||
MsgProvisionResponse.decode(new _m0.Reader(data)), | ||||
); | ||||
} | ||||
|
@@ -653,7 +653,7 @@ function base64FromBytes(arr) { | |||
return globalThis.Buffer.from(arr).toString('base64'); | ||||
} else { | ||||
const bin = []; | ||||
arr.forEach((byte) => { | ||||
arr.forEach(byte => { | ||||
bin.push(String.fromCharCode(byte)); | ||||
}); | ||||
return globalThis.btoa(bin.join('')); | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigh... indenting the whole body of the function is mildly annoying. If I saw this while writing code, I might shift things around.