Skip to content

Commit db2cba6

Browse files
committed
chore: bump Prettier to ^3.3.3 and interop deps
Aligns the Prettier stack with the ranges core uses. prettier ^2.7.1 -> ^3.3.3 eslint-config-prettier ^8.8.0 -> ^9.1.0 eslint-plugin-prettier ^4.2.1 -> ^5.2.1 prettier-plugin-packagejson ^2.3.0 -> ^2.5.3 Prettier 3 reflows union types and one boolean expression, so src/json.ts and src/transaction-types.ts pick up formatting only changes. No behaviour changes; build, 1993 tests and tsd all still pass. This has to land before the ESLint v15 bump, since eslint-plugin-prettier@^5 peer requires prettier >= 3. In the meantime yarn reports peer warnings because eslint-config@12 still asks for the version 2 stack. Those clear in the next PR.
1 parent 5aef526 commit db2cba6

4 files changed

Lines changed: 116 additions & 176 deletions

File tree

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,18 @@
9292
"@typescript-eslint/parser": "^5.43.0",
9393
"depcheck": "^1.4.7",
9494
"eslint": "^8.44.0",
95-
"eslint-config-prettier": "^8.8.0",
95+
"eslint-config-prettier": "^9.1.0",
9696
"eslint-plugin-import": "^2.27.5",
9797
"eslint-plugin-jest": "^27.2.2",
9898
"eslint-plugin-jsdoc": "^39.9.1",
9999
"eslint-plugin-n": "^15.7.0",
100-
"eslint-plugin-prettier": "^4.2.1",
100+
"eslint-plugin-prettier": "^5.2.1",
101101
"eslint-plugin-promise": "^6.1.1",
102102
"jest": "^29.2.2",
103103
"jest-it-up": "^2.0.2",
104104
"jest-when": "^3.6.0",
105-
"prettier": "^2.7.1",
106-
"prettier-plugin-packagejson": "^2.3.0",
105+
"prettier": "^3.3.3",
106+
"prettier-plugin-packagejson": "^2.5.3",
107107
"stdio-mock": "^1.2.0",
108108
"ts-jest": "^29.0.3",
109109
"ts-node": "^10.7.0",

src/json.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ import { hasProperty } from './misc';
3434
* Any JSON-compatible value.
3535
*/
3636
export type Json =
37-
| null
38-
| boolean
39-
| number
40-
| string
41-
| Json[]
42-
| { [prop: string]: Json };
37+
null | boolean | number | string | Json[] | { [prop: string]: Json };
4338

4439
/**
4540
* A helper type to make properties with `undefined` in their type optional, but
@@ -53,15 +48,15 @@ export type Json =
5348
* ```
5449
*/
5550
export type ObjectOptional<Schema extends Record<string, unknown>> = {
56-
[Key in keyof Schema as Schema[Key] extends ExactOptionalGuard
57-
? Key
58-
: never]?: Schema[Key] extends ExactOptionalGuard & infer Original
51+
[
52+
Key in keyof Schema as Schema[Key] extends ExactOptionalGuard ? Key : never
53+
]?: Schema[Key] extends ExactOptionalGuard & infer Original
5954
? Original
6055
: never;
6156
} & {
62-
[Key in keyof Schema as Schema[Key] extends ExactOptionalGuard
63-
? never
64-
: Key]: Schema[Key];
57+
[
58+
Key in keyof Schema as Schema[Key] extends ExactOptionalGuard ? never : Key
59+
]: Schema[Key];
6560
};
6661

6762
/**
@@ -488,8 +483,7 @@ export const JsonRpcResponseStruct = union([
488483
* @template Result - The type of the result.
489484
*/
490485
export type JsonRpcResponse<Result extends Json = Json> =
491-
| JsonRpcSuccess<Result>
492-
| JsonRpcFailure;
486+
JsonRpcSuccess<Result> | JsonRpcFailure;
493487

494488
/**
495489
* Type guard to check whether specified JSON-RPC response is a
@@ -699,8 +693,8 @@ export function getJsonRpcIdValidator(options?: JsonRpcValidatorOptions) {
699693
const isValidJsonRpcId = (id: unknown): id is JsonRpcId => {
700694
return Boolean(
701695
(typeof id === 'number' && (permitFractions || Number.isInteger(id))) ||
702-
(typeof id === 'string' && (permitEmptyString || id.length > 0)) ||
703-
(permitNull && id === null),
696+
(typeof id === 'string' && (permitEmptyString || id.length > 0)) ||
697+
(permitNull && id === null),
704698
);
705699
};
706700

src/transaction-types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import type { Bytes } from './bytes';
22
import type { Hex } from './hex';
33

44
export type Transaction =
5-
| LegacyTransaction
6-
| EIP2930Transaction
7-
| EIP1559Transaction;
5+
LegacyTransaction | EIP2930Transaction | EIP1559Transaction;
86

97
export type SignedTransaction = Transaction & Signature;
108

0 commit comments

Comments
 (0)