Skip to content

Commit

Permalink
Run style:fix with the new, actually working config (#2365)
Browse files Browse the repository at this point in the history
See previous PR.
  • Loading branch information
steveluscher authored Mar 22, 2024
1 parent d2c0daf commit 65f262c
Show file tree
Hide file tree
Showing 34 changed files with 90 additions and 232 deletions.
21 changes: 10 additions & 11 deletions packages/accounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ assertAccountsExist(myAccounts);

// Now we can use them as an array of accounts
for (const a of myAccounts) {
a satisfies EncodedAccount<Address>;
a satisfies EncodedAccount<Address>;
}
```

Expand Down Expand Up @@ -284,16 +284,15 @@ account.data satisfies MyAccountData;

This is particularly useful for narrowing the result of fetching a JSON parsed account.


```ts
const account: MaybeAccount<MockData | Uint8Array> = await fetchJsonParsedAccount<MockData>(
rpc,
'1234..5678' as Address,
)

assertAccountDecoded(account);
// now we have a MaybeAccount<MockData>
account satisfies MaybeAccount<MockData>
const account: MaybeAccount<MockData | Uint8Array> = await fetchJsonParsedAccount<MockData>(
rpc,
'1234..5678' as Address,
);

assertAccountDecoded(account);
// now we have a MaybeAccount<MockData>
account satisfies MaybeAccount<MockData>;
```

### `assertAccountsDecoded`
Expand All @@ -307,7 +306,7 @@ const myAccounts: Account<MyAccountData | Uint8Array, Address>[];
assertAccountsDecoded(myAccounts);

// now the account data can be used as MyAccountData
for(const a of account) {
for (const a of account) {
account.data satisfies MyAccountData;
}
```
6 changes: 2 additions & 4 deletions packages/accounts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/accounts",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
14 changes: 3 additions & 11 deletions packages/addresses/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM",
"ES2015",
"ES2019.Array",
"ES2020.BigInt",
"ES2022.Error"
]
"lib": ["DOM", "ES2015", "ES2019.Array", "ES2020.BigInt", "ES2022.Error"]
},
"display": "@solana/addresses",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
11 changes: 3 additions & 8 deletions packages/assertions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/addresses",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
],
"include": ["src"],
"compilerOptions": {
"lib": [
"DOM",
"ES2015"
]
"lib": ["DOM", "ES2015"]
}
}
}
12 changes: 3 additions & 9 deletions packages/codecs-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/codecs-core",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
],
"include": ["src"],
"compilerOptions": {
"lib": [
"DOM",
"ES2020",
"ES2022.Error"
]
"lib": ["DOM", "ES2020", "ES2022.Error"]
}
}
}
12 changes: 3 additions & 9 deletions packages/codecs-data-structures/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/codecs-data-structures",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
],
"include": ["src"],
"compilerOptions": {
"lib": [
"DOM",
"ES2019",
"ES2022.Error"
]
"lib": ["DOM", "ES2019", "ES2022.Error"]
}
}
}
14 changes: 3 additions & 11 deletions packages/codecs-numbers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/codecs-numbers",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
],
"include": ["src"],
"compilerOptions": {
"lib": [
"DOM",
"ES2015",
"ES2017.String",
"ES2020.BigInt",
"ES2022.Error"
]
"lib": ["DOM", "ES2015", "ES2017.String", "ES2020.BigInt", "ES2022.Error"]
}
}
}
13 changes: 3 additions & 10 deletions packages/codecs-strings/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM",
"ES2020",
"ES2020.BigInt",
"ES2022.Error"
]
"lib": ["DOM", "ES2020", "ES2020.BigInt", "ES2022.Error"]
},
"display": "@solana/codecs-strings",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
6 changes: 2 additions & 4 deletions packages/codecs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/codecs",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
14 changes: 3 additions & 11 deletions packages/compat/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM",
"ES2017",
"ES2019.Array",
"ES2020.BigInt",
"ES2022.Error"
],
"lib": ["DOM", "ES2017", "ES2019.Array", "ES2020.BigInt", "ES2022.Error"],
"resolveJsonModule": true
},
"display": "@solana/compat",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
10 changes: 3 additions & 7 deletions packages/crypto-impl/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM"
]
"lib": ["DOM"]
},
"display": "Crypto Implementation",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/crypto-impl/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export default defineConfig(_options =>
platform,
sourcemap: true,
treeshake: true,
}))
})),
);
13 changes: 3 additions & 10 deletions packages/errors/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM",
"ES2015",
"ES2022.Error"
],
"lib": ["DOM", "ES2015", "ES2022.Error"],
"resolveJsonModule": true
},
"display": "@solana/errors",
"extends": "@solana/tsconfig/base.json",
"include": [
"bin",
"src"
],
}
"include": ["bin", "src"]
}
2 changes: 1 addition & 1 deletion packages/functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ const transferTransaction = pipe(
// The return value of that function gets passed to the next...
tx => setTransactionLifetimeUsingBlockhash(latestBlockhash, tx),
// ...and so on.
tx => appendTransactionInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx)
tx => appendTransactionInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),
);
```
12 changes: 3 additions & 9 deletions packages/functional/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM",
"ES2015",
"ES2022.Error"
]
"lib": ["DOM", "ES2015", "ES2022.Error"]
},
"display": "@solana/functional",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
6 changes: 3 additions & 3 deletions packages/instructions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Use this type to specify an instruction that contains certain accounts.
type InstructionWithTwoAccounts = IInstructionWithAccounts<
[
WritableAccount, // First account
RentSysvar // Second account
RentSysvar, // Second account
]
>;
```
Expand All @@ -98,13 +98,13 @@ For example, here is how the `AdvanceNonce` instruction is typed.
```ts
type AdvanceNonceAccountInstruction<
TNonceAccountAddress extends string = string,
TNonceAuthorityAddress extends string = string
TNonceAuthorityAddress extends string = string,
> = IInstruction<'11111111111111111111111111111111'> &
IInstructionWithAccounts<
[
WritableAccount<TNonceAccountAddress>,
ReadonlyAccount<'SysvarRecentB1ockHashes11111111111111111111'>,
ReadonlySignerAccount<TNonceAuthorityAddress>
ReadonlySignerAccount<TNonceAuthorityAddress>,
]
> &
IInstructionWithData<AdvanceNonceAccountInstructionData>;
Expand Down
6 changes: 2 additions & 4 deletions packages/instructions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/instructions",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
12 changes: 3 additions & 9 deletions packages/keys/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/keys",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
],
"include": ["src"],
"compilerOptions": {
"lib": [
"DOM",
"ES2015",
"ES2022.Error"
]
"lib": ["DOM", "ES2015", "ES2022.Error"]
}
}
}
10 changes: 3 additions & 7 deletions packages/library-legacy-sham/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"paths": {
"@solana/web3.js-legacy": [
"./node_modules/@solana/web3.js-legacy/declarations/index.d.ts"
]
"@solana/web3.js-legacy": ["./node_modules/@solana/web3.js-legacy/declarations/index.d.ts"]
}
},
"display": "@solana/web3.js-legacy-sham",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
11 changes: 3 additions & 8 deletions packages/options/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": [
"DOM",
"ES2019"
]
"lib": ["DOM", "ES2019"]
},
"display": "@solana/options",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
6 changes: 2 additions & 4 deletions packages/programs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "@solana/instructions",
"extends": "@solana/tsconfig/base.json",
"include": [
"src"
]
}
"include": ["src"]
}
Loading

0 comments on commit 65f262c

Please sign in to comment.