Skip to content

Commit fc9adb3

Browse files
committed
chore: Fix auto-fixable errors
1 parent c623661 commit fc9adb3

File tree

8 files changed

+28
-25
lines changed

8 files changed

+28
-25
lines changed

src/__fixtures__/json.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,6 @@ export const JSON_RPC_PENDING_RESPONSE_FIXTURES = {
10541054
],
10551055
};
10561056

1057-
/* eslint-disable @typescript-eslint/naming-convention */
10581057
export const CHARACTER_MAP = {
10591058
'"': '\\"',
10601059
'\\': '\\\\',
@@ -1091,7 +1090,6 @@ export const CHARACTER_MAP = {
10911090
'\x1E': '\\u001e',
10921091
'\x1F': '\\u001f',
10931092
};
1094-
/* eslint-enable @typescript-eslint/naming-convention */
10951093

10961094
const DIRECT_CIRCULAR_REFERENCE_ARRAY: unknown[] = [];
10971095
DIRECT_CIRCULAR_REFERENCE_ARRAY.push(DIRECT_CIRCULAR_REFERENCE_ARRAY);

src/assert.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ function getErrorMessageWithoutTrailingPeriod(error: unknown): string {
4343
* @param message - The error message.
4444
* @returns The error object.
4545
*/
46-
// eslint-disable-next-line @typescript-eslint/naming-convention
46+
47+
/**
48+
*
49+
* @param ErrorWrapper
50+
* @param message
51+
*/
4752
function getError(ErrorWrapper: AssertionErrorConstructor, message: string) {
4853
if (isConstructable(ErrorWrapper)) {
4954
return new ErrorWrapper({
@@ -81,7 +86,7 @@ export class AssertionError extends Error {
8186
export function assert(
8287
value: any,
8388
message: string | Error = 'Assertion failed.',
84-
// eslint-disable-next-line @typescript-eslint/naming-convention
89+
8590
ErrorWrapper: AssertionErrorConstructor = AssertionError,
8691
): asserts value {
8792
if (!value) {
@@ -108,7 +113,7 @@ export function assertStruct<Type, Schema>(
108113
value: unknown,
109114
struct: Struct<Type, Schema>,
110115
errorPrefix = 'Assertion failed',
111-
// eslint-disable-next-line @typescript-eslint/naming-convention
116+
112117
ErrorWrapper: AssertionErrorConstructor = AssertionError,
113118
): asserts value is Type {
114119
try {

src/collections.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('FrozenMap', () => {
103103
const frozenMap = new FrozenMap([['a', 1]]);
104104
frozenMap.forEach(function () {
105105
// @ts-expect-error: We have to shadow `this` here.
106-
expect(this).toBeUndefined(); // eslint-disable-line no-invalid-this
106+
expect(this).toBeUndefined();
107107
});
108108
});
109109

@@ -113,7 +113,7 @@ describe('FrozenMap', () => {
113113
const thisArg = {};
114114
frozenMap.forEach(function () {
115115
// @ts-expect-error: We have to shadow `this` here.
116-
expect(this).toBe(thisArg); // eslint-disable-line no-invalid-this
116+
expect(this).toBe(thisArg);
117117
}, thisArg);
118118
});
119119

@@ -317,7 +317,7 @@ describe('FrozenSet', () => {
317317
const frozenSet = new FrozenSet(['a']);
318318
frozenSet.forEach(function () {
319319
// @ts-expect-error: We have to shadow `this` here.
320-
expect(this).toBeUndefined(); // eslint-disable-line no-invalid-this
320+
expect(this).toBeUndefined();
321321
});
322322
});
323323

@@ -327,7 +327,7 @@ describe('FrozenSet', () => {
327327
const thisArg = {};
328328
frozenSet.forEach(function () {
329329
// @ts-expect-error: We have to shadow `this` here.
330-
expect(this).toBe(thisArg); // eslint-disable-line no-invalid-this
330+
expect(this).toBe(thisArg);
331331
}, thisArg);
332332
});
333333

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ export * from './caip-types';
55
export * from './checksum';
66
export * from './coercers';
77
export * from './collections';
8-
export * from './encryption-types';
8+
export type * from './encryption-types';
99
export * from './errors';
1010
export * from './hex';
1111
export * from './json';
12-
export * from './keyring';
12+
export type * from './keyring';
1313
export * from './logging';
1414
export * from './misc';
1515
export * from './number';
16-
export * from './opaque';
16+
export type * from './opaque';
1717
export * from './promise';
1818
export * from './superstruct';
1919
export * from './time';
20-
export * from './transaction-types';
20+
export type * from './transaction-types';
2121
export * from './versions';

src/json.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export function getJsonSize(value: unknown): number {
279279
/**
280280
* The string '2.0'.
281281
*/
282-
export const jsonrpc2 = '2.0' as const;
282+
export const jsonrpc2 = '2.0';
283283
export const JsonRpcVersionStruct = literal(jsonrpc2);
284284

285285
/**
@@ -385,7 +385,7 @@ export function isJsonRpcNotification(
385385
*/
386386
export function assertIsJsonRpcNotification(
387387
value: unknown,
388-
// eslint-disable-next-line @typescript-eslint/naming-convention
388+
389389
ErrorWrapper?: AssertionErrorConstructor,
390390
): asserts value is JsonRpcNotification {
391391
assertStruct(
@@ -416,7 +416,7 @@ export function isJsonRpcRequest(value: unknown): value is JsonRpcRequest {
416416
*/
417417
export function assertIsJsonRpcRequest(
418418
value: unknown,
419-
// eslint-disable-next-line @typescript-eslint/naming-convention
419+
420420
ErrorWrapper?: AssertionErrorConstructor,
421421
): asserts value is JsonRpcRequest {
422422
assertStruct(
@@ -510,7 +510,7 @@ export function isPendingJsonRpcResponse(
510510
*/
511511
export function assertIsPendingJsonRpcResponse(
512512
response: unknown,
513-
// eslint-disable-next-line @typescript-eslint/naming-convention
513+
514514
ErrorWrapper?: AssertionErrorConstructor,
515515
): asserts response is PendingJsonRpcResponse {
516516
assertStruct(
@@ -543,7 +543,7 @@ export function isJsonRpcResponse(
543543
*/
544544
export function assertIsJsonRpcResponse(
545545
value: unknown,
546-
// eslint-disable-next-line @typescript-eslint/naming-convention
546+
547547
ErrorWrapper?: AssertionErrorConstructor,
548548
): asserts value is JsonRpcResponse {
549549
assertStruct(
@@ -574,7 +574,7 @@ export function isJsonRpcSuccess(value: unknown): value is JsonRpcSuccess {
574574
*/
575575
export function assertIsJsonRpcSuccess(
576576
value: unknown,
577-
// eslint-disable-next-line @typescript-eslint/naming-convention
577+
578578
ErrorWrapper?: AssertionErrorConstructor,
579579
): asserts value is JsonRpcSuccess {
580580
assertStruct(
@@ -605,7 +605,7 @@ export function isJsonRpcFailure(value: unknown): value is JsonRpcFailure {
605605
*/
606606
export function assertIsJsonRpcFailure(
607607
value: unknown,
608-
// eslint-disable-next-line @typescript-eslint/naming-convention
608+
609609
ErrorWrapper?: AssertionErrorConstructor,
610610
): asserts value is JsonRpcFailure {
611611
assertStruct(
@@ -636,7 +636,7 @@ export function isJsonRpcError(value: unknown): value is JsonRpcError {
636636
*/
637637
export function assertIsJsonRpcError(
638638
value: unknown,
639-
// eslint-disable-next-line @typescript-eslint/naming-convention
639+
640640
ErrorWrapper?: AssertionErrorConstructor,
641641
): asserts value is JsonRpcError {
642642
assertStruct(

src/misc.test-d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { isObject, hasProperty, getKnownPropertyNames } from './misc';
88
//=============================================================================
99

1010
class ClassWithPrivateProperties {
11-
#foo: string;
11+
readonly #foo: string;
1212

1313
bar: string;
1414

@@ -47,7 +47,7 @@ if (hasProperty(constObjectType, 'foo')) {
4747
//=============================================================================
4848

4949
// eslint-disable-next-line @typescript-eslint/ban-types
50-
const unknownObject = {} as Object;
50+
const unknownObject = {} as object;
5151

5252
// Establish that `Object` is not accepted when a specific property is needed.
5353
expectNotAssignable<Record<'foo', unknown>>(unknownObject);
@@ -143,7 +143,6 @@ expectAssignable<RuntimeObject>({});
143143

144144
expectAssignable<RuntimeObject>({ foo: 'foo' });
145145

146-
// eslint-disable-next-line @typescript-eslint/naming-convention
147146
expectAssignable<RuntimeObject>({ 0: 'foo' });
148147

149148
expectAssignable<RuntimeObject>({ [Symbol('foo')]: 'foo' });

src/misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function isObject(value: unknown): value is RuntimeObject {
9797
*/
9898
export const hasProperty = <
9999
// eslint-disable-next-line @typescript-eslint/ban-types
100-
ObjectToCheck extends Object,
100+
ObjectToCheck extends object,
101101
Property extends PropertyKey,
102102
>(
103103
objectToCheck: ObjectToCheck,

src/promise.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* A deferred Promise is one that can be resolved or rejected independently of
55
* the Promise construction.
6+
*
67
* @template Result - The result type of the Promise.
78
*/
89
export type DeferredPromise<Result = void> = {

0 commit comments

Comments
 (0)