Skip to content

Commit

Permalink
fix eslint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
  • Loading branch information
TimoGlastra committed Jun 25, 2024
1 parent c8a4511 commit 0612aae
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 110 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
},
},
rules: {
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@types/uuid": "^9.0.1",
"@types/varint": "^6.0.0",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"bn.js": "^5.2.1",
"cors": "^2.8.5",
"eslint": "^8.36.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { fetchCredentialDefinition } from '../../utils/anonCredsObjects'
import {
getIndyNamespaceFromIndyDid,
getQualifiedDidIndyDid,
getUnQualifiedDidIndyDid,
getUnqualifiedRevocationRegistryDefinitionId,
isIndyDid,
isUnqualifiedCredentialDefinitionId,
Expand Down
3 changes: 2 additions & 1 deletion packages/drpc/src/models/ValidRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ValidateBy, ValidationError, buildMessage } from 'class-validator'

export function IsValidDrpcRequest(validationOptions?: ValidationOptions): PropertyDecorator {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function (target: any, propertyKey: string | symbol) {
return (target: any, propertyKey: string | symbol) => {
ValidateBy(
{
name: 'isValidDrpcRequest',
Expand Down Expand Up @@ -36,6 +36,7 @@ export function IsValidDrpcRequest(validationOptions?: ValidationOptions): Prope
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function isValidDrpcRequest(value: any): boolean {
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
return false
Expand Down
4 changes: 3 additions & 1 deletion packages/drpc/src/models/ValidResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ValidateBy, ValidationError, buildMessage } from 'class-validator'

export function IsValidDrpcResponse(validationOptions?: ValidationOptions): PropertyDecorator {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function (target: any, propertyKey: string | symbol) {
return (target: any, propertyKey: string | symbol) => {
ValidateBy(
{
name: 'isValidDrpcResponse',
Expand Down Expand Up @@ -36,6 +36,7 @@ export function IsValidDrpcResponse(validationOptions?: ValidationOptions): Prop
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function isValidDrpcResponse(value: any): boolean {
// Check if value is an object
if (typeof value !== 'object' || value === null) {
Expand All @@ -62,6 +63,7 @@ export function isValidDrpcResponse(value: any): boolean {
return false
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isValidDrpcResponseError(error: any): boolean {
return typeof error === 'object' && error !== null && 'code' in error && 'message' in error
}
Loading

0 comments on commit 0612aae

Please sign in to comment.