Skip to content

Commit 56b1ec4

Browse files
committed
chore: add jsdoc formatting and run format
1 parent a7c0ff8 commit 56b1ec4

File tree

14 files changed

+102
-53
lines changed

14 files changed

+102
-53
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
"prettier": {
1313
"printWidth": 80,
1414
"semi": false,
15-
"trailingComma": "all"
15+
"trailingComma": "all",
16+
"jsdocExperimentalFormatCommentsWithoutTags": true,
17+
"plugins": [
18+
"@homer0/prettier-plugin-jsdoc"
19+
]
1620
},
1721
"devDependencies": {
22+
"@homer0/prettier-plugin-jsdoc": "^10.0.1",
1823
"@rollup/plugin-alias": "^6.0.0",
1924
"@rollup/plugin-node-resolve": "^16.0.3",
2025
"prettier": "^3.7.1",

packages/common-utils/src/flattenResult.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export type Result<S = unknown, E = unknown> =
1010
| { success: false; value: E }
1111

1212
/**
13-
* Flattens a nested Result<Result<Result<number>, ErrorA>, ErrorB>, ErrorC> into
14-
* { value: number } | null
13+
* Flattens a nested Result<Result<Result<number>, ErrorA>, ErrorB>, ErrorC>
14+
* into { value: number } | null.
1515
*/
1616
export const flattenValues = <T>(v: T): { value: FlattenValues<T> } | null => {
1717
const result = flattenResult(v)
@@ -25,8 +25,8 @@ export type FlattenValues<T> =
2525
: T
2626

2727
/**
28-
* Flattens a nested Result<Result<Result<number>, ErrorA>, ErrorB>, ErrorC> into
29-
* { error: ErrorA | ErrorB | ErrorC } | null
28+
* Flattens a nested Result<Result<Result<number>, ErrorA>, ErrorB>, ErrorC>
29+
* into { error: ErrorA | ErrorB | ErrorC } | null.
3030
*/
3131
export const flattenErrors = <T>(v: T): { error: FlattenErrors<T> } | null => {
3232
const result = flattenResult(v)
@@ -42,8 +42,8 @@ export type FlattenErrors<T> =
4242
: never
4343

4444
/**
45-
* Flattens a nested Result<Result<Result<number>, ErrorA>, ErrorB>, ErrorC> into
46-
* Result<number, ErrorA | ErrorB | ErrorC>
45+
* Flattens a nested Result<Result<Result<number>, ErrorA>, ErrorB>, ErrorC>
46+
* into Result<number, ErrorA | ErrorB | ErrorC>
4747
*/
4848
export const flattenResult = <T>(v: T): FlattenResult<T> =>
4949
isResult(v)

packages/sdk-accounts/src/identity/descriptors.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ type IdentitySdkPallets = PalletsTypedef<
9292
{
9393
Identity: {
9494
/**
95-
* Information that is pertinent to identify the entity behind an account. First item is the
96-
* registration, second is the account's primary username.
95+
* Information that is pertinent to identify the entity behind an account.
96+
* First item is the registration, second is the account's primary
97+
* username.
9798
*
9899
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
99100
*/ IdentityOf: StorageDescriptor<
@@ -103,8 +104,9 @@ type IdentitySdkPallets = PalletsTypedef<
103104
never
104105
>
105106
/**
106-
* The super-identity of an alternative "sub" identity together with its name, within that
107-
* context. If the account is not some other account's sub-identity, then just `None`.
107+
* The super-identity of an alternative "sub" identity together with its
108+
* name, within that context. If the account is not some other account's
109+
* sub-identity, then just `None`.
108110
*/
109111
SuperOf: StorageDescriptor<
110112
[Key: SS58String],

packages/sdk-accounts/src/linkedAccounts/descriptors.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ type LinkedAccountsSdkPallets = PalletsTypedef<
1111
{
1212
Proxy: {
1313
/**
14-
* The set of account proxies. Maps the account which has delegated to the accounts
15-
* which are being delegated to, together with the amount held on deposit.
14+
* The set of account proxies. Maps the account which has delegated to the
15+
* accounts which are being delegated to, together with the amount held on
16+
* deposit.
1617
*/
1718
Proxies: StorageDescriptor<
1819
[Key: SS58String],

packages/sdk-accounts/src/linkedAccounts/multisigProviders/subscan-provider.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import { MultisigProvider } from "../sdk-types"
44
/**
55
* Multisig provider for subscan API.
66
*
7-
* See `throttleMultisigProvider` to throttle down requests to your API key limits.
7+
* See `throttleMultisigProvider` to throttle down requests to your API key
8+
* limits.
89
*
9-
* @param chain See supported chains in https://support.subscan.io/doc-361776
10-
* @param subscanApiKey API key from subscan
10+
* @param chain See supported chains in
11+
* https://support.subscan.io/doc-361776
12+
* @param subscanApiKey API key from subscan.
1113
*/
1214
export function subscanProvider(
1315
chain: string,

packages/sdk-accounts/src/linkedAccounts/multisigProviders/throttle-provider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { MultisigProvider } from "../sdk-types"
44
* Throttles down the requests to the provider. By default it drops new requests
55
* after the maximum concurrent requests has been reached.
66
*
7-
* @param provider Multisig provider to throttle
8-
* @param maxConcurrent Maximum amount of concurrent requests
9-
* @param wait Queue requests instead of dropping them. It can cause backpressure.
7+
* @param provider Multisig provider to throttle.
8+
* @param maxConcurrent Maximum amount of concurrent requests.
9+
* @param wait Queue requests instead of dropping them. It can
10+
* cause backpressure.
1011
*/
1112
export function throttleMultisigProvider(
1213
provider: MultisigProvider,

packages/sdk-governance/src/bounties/descriptors.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ type BountiesSdkPallets<TOrigin> = PalletsTypedef<
7474
}
7575
Scheduler: {
7676
/**
77-
* Items to be executed, indexed by the block number that they should be executed on.
77+
* Items to be executed, indexed by the block number that they should be
78+
* executed on.
7879
*/
7980
Agenda: StorageDescriptor<
8081
[Key: number],
@@ -128,7 +129,7 @@ type BountiesSdkPallets<TOrigin> = PalletsTypedef<
128129
{
129130
Bounties: {
130131
/**
131-
*New bounty proposal.
132+
* New bounty proposal.
132133
*/
133134
BountyProposed: PlainDescriptor<{
134135
index: number

packages/sdk-governance/src/referenda/sdk-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export interface ReferendaSdkConfig {
6666
}
6767

6868
/**
69-
* threshold are in perbillion
69+
* Threshold are in perbillion.
7070
*/
7171
export interface TrackFunctionDetails {
7272
curve: ReferendaTypesCurve

packages/sdk-governance/src/voting/sdk-types.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ export type PollOutcome = {
99

1010
/**
1111
* Types:
12-
* - free: The funds locked by this vote will become free once the vote is removed.
13-
* - locked: The funds locked by this vote will become locked once the vote is removed.
14-
* - extends: Removing this vote will extend the duration of a pre-existing lock.
15-
* - extended: Removing this vote before its end will have it locked for the duration of the pre-existing lock.
12+
* - free: The funds locked by this vote will become free once the vote is
13+
* removed.
14+
* - locked: The funds locked by this vote will become locked once the vote is
15+
* removed.
16+
* - extends: Removing this vote will extend the duration of a pre-existing
17+
* lock.
18+
* - extended: Removing this vote before its end will have it locked for the
19+
* duration of the pre-existing lock.
1620
*/
1721
export type VoteLock =
1822
| {

packages/sdk-ink/src/revive-sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { defaultOptions, type InkSdkOptions, type ReviveSdk } from "./sdk-types"
1313
import { ss58ToEthereum } from "./util"
1414

1515
/**
16-
* @deprecated use `createInkSdk(client)` instead
16+
* @deprecated Use `createInkSdk(client)` instead.
1717
*/
1818
export const createReviveSdk = <
1919
T extends ReviveSdkTypedApi,

0 commit comments

Comments
 (0)