Skip to content

Commit

Permalink
Enable rule noUselessConstructor
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Sep 25, 2024
1 parent 4704ad3 commit 5615a91
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 41 deletions.
1 change: 0 additions & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"noForEach": "off",
"noStaticOnlyClass": "off",
"noThisInStatic": "off",
"noUselessConstructor": "off",
"noUselessEmptyExport": "off",
"noUselessTypeConstraint": "off",
"useArrowFunction": "off",
Expand Down
6 changes: 1 addition & 5 deletions packages/beacon-node/src/util/queue/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export enum QueueErrorCode {

export type QueueErrorCodeType = {code: QueueErrorCode.QUEUE_ABORTED} | {code: QueueErrorCode.QUEUE_MAX_LENGTH};

export class QueueError extends LodestarError<QueueErrorCodeType> {
constructor(type: QueueErrorCodeType) {
super(type);
}
}
export class QueueError extends LodestarError<QueueErrorCodeType> {}

export function isQueueErrorAborted(e: unknown): e is QueueError {
return e instanceof QueueError && e.type.code === QueueErrorCode.QUEUE_ABORTED;
Expand Down
6 changes: 1 addition & 5 deletions packages/fork-choice/src/forkChoice/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,4 @@ export type ForkChoiceErrorType =
| {code: ForkChoiceErrorCode.UNABLE_TO_SET_JUSTIFIED_CHECKPOINT; error: Error}
| {code: ForkChoiceErrorCode.AFTER_BLOCK_FAILED; error: Error};

export class ForkChoiceError extends LodestarError<ForkChoiceErrorType> {
constructor(type: ForkChoiceErrorType) {
super(type);
}
}
export class ForkChoiceError extends LodestarError<ForkChoiceErrorType> {}
6 changes: 1 addition & 5 deletions packages/fork-choice/src/protoArray/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,4 @@ export type ProtoArrayErrorType =
| {code: ProtoArrayErrorCode.INVALID_JUSTIFIED_EXECUTION_STATUS; root: RootHex}
| ({code: ProtoArrayErrorCode.INVALID_LVH_EXECUTION_RESPONSE} & LVHExecError);

export class ProtoArrayError extends LodestarError<ProtoArrayErrorType> {
constructor(type: ProtoArrayErrorType) {
super(type);
}
}
export class ProtoArrayError extends LodestarError<ProtoArrayErrorType> {}
6 changes: 1 addition & 5 deletions packages/reqresp/src/encodingStrategies/sszSnappy/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ type SszSnappyErrorType =
| {code: SszSnappyErrorCode.TOO_MANY_BYTES; sszDataLength: number}
| {code: SszSnappyErrorCode.SOURCE_ABORTED};

export class SszSnappyError extends LodestarError<SszSnappyErrorType> {
constructor(type: SszSnappyErrorType) {
super(type);
}
}
export class SszSnappyError extends LodestarError<SszSnappyErrorType> {}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,4 @@ type InvalidAttestationErrorType =
minTargetEpoch: Epoch;
};

export class InvalidAttestationError extends LodestarError<InvalidAttestationErrorType> {
constructor(type: InvalidAttestationErrorType) {
super(type);
}
}
export class InvalidAttestationError extends LodestarError<InvalidAttestationErrorType> {}
6 changes: 1 addition & 5 deletions packages/validator/src/slashingProtection/block/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ type InvalidBlockErrorType =
minSlot: Slot;
};

export class InvalidBlockError extends LodestarError<InvalidBlockErrorType> {
constructor(type: InvalidBlockErrorType) {
super(type);
}
}
export class InvalidBlockError extends LodestarError<InvalidBlockErrorType> {}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ type InterchangeErrorErrorType =
| {code: InterchangeErrorErrorCode.UNSUPPORTED_VERSION; version: string}
| {code: InterchangeErrorErrorCode.GENESIS_VALIDATOR_MISMATCH; root: Root; expectedRoot: Root};

export class InterchangeError extends LodestarError<InterchangeErrorErrorType> {
constructor(type: InterchangeErrorErrorType) {
super(type);
}
}
export class InterchangeError extends LodestarError<InterchangeErrorErrorType> {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@ type SurroundAttestationErrorType =
attestation2Target: number;
};

export class SurroundAttestationError extends LodestarError<SurroundAttestationErrorType> {
constructor(type: SurroundAttestationErrorType) {
super(type);
}
}
export class SurroundAttestationError extends LodestarError<SurroundAttestationErrorType> {}

0 comments on commit 5615a91

Please sign in to comment.