Skip to content

Commit

Permalink
fix eslint errors 3
Browse files Browse the repository at this point in the history
  • Loading branch information
RamRamez committed Jun 8, 2024
1 parent 7325ede commit d165b3a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/entities/ThirdParty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import {
CreateDateColumn,
Entity,
Index,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
RelationId,
UpdateDateColumn,
} from 'typeorm';
import { NotificationSetting } from './notificationSetting';

// Schema designed based on https://github.com/Giveth/giveth-dapps-v2/issues/475
@Entity()
Expand Down
6 changes: 2 additions & 4 deletions src/entities/userAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import {
CreateDateColumn,
Entity,
Index,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
RelationId,
UpdateDateColumn,
} from 'typeorm';
import { NotificationSetting } from './notificationSetting';
Expand All @@ -23,11 +21,11 @@ export class UserAddress extends BaseEntity {
@Column('text', { nullable: false })
walletAddress: string;

@OneToMany(type => Notification, notification => notification.userAddress)
@OneToMany(_type => Notification, notification => notification.userAddress)
notifications?: Notification[];

@OneToMany(
type => NotificationSetting,
_type => NotificationSetting,
notificationSetting => notificationSetting.userAddress,
)
settings?: NotificationSetting[];
Expand Down
2 changes: 0 additions & 2 deletions src/repositories/userAddressRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { assert } from 'chai';
import {
generateRandomEthereumAddress,
saveUserAddressDirectlyToDb,
sleep,
} from '../../test/testUtils';
import { NotificationSetting } from '../entities/notificationSetting';
import { MICRO_SERVICES } from '../utils/utils';
import {
createNewUserAddress,
createNewUserAddressIfNotExists,
Expand Down
3 changes: 1 addition & 2 deletions src/validators/schemaValidators.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Joi, { number, ObjectSchema, ValidationResult } from 'joi';
import Joi, { ObjectSchema, ValidationResult } from 'joi';
import { StandardError } from '../types/StandardError';
import { errorMessagesEnum } from '../utils/errorMessages';

const ethereumWalletAddressRegex = /^0x[a-fA-F0-9]{40}$/;
const solanaWalletAddressRegex = /^[A-Za-z0-9]{43,44}$/;
const txHashRegex = /^0x[a-fA-F0-9]{64}$/;

export const validateWithJoiSchema = (data: any, schema: ObjectSchema) => {
const validationResult = schema.validate(data);
Expand Down
4 changes: 1 addition & 3 deletions test/pre-test-scripts.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import dotenv from 'dotenv';
import * as path from 'path';
import dotenv from 'dotenv';
dotenv.config({
path: path.resolve(__dirname, `../config/${process.env.NODE_ENV || ''}.env`),
});

import { initServer } from '../src/server';
import { AppDataSource } from '../src/dataSource';
import { ThirdParty } from '../src/entities/ThirdParty';
import { Notification } from '../src/entities/notification';
import { sleep } from './testUtils';

/* eslint-disable @typescript-eslint/no-var-requires */
Expand Down
4 changes: 2 additions & 2 deletions test/testUtils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { assert } from 'chai';
import { sign } from 'jsonwebtoken';
import { Keypair } from '@solana/web3.js';
import { Notification } from '../src/entities/notification';
import { UserAddress } from '../src/entities/userAddress';
import { NotificationType } from '../src/entities/notificationType';
import { createBasicAuthentication } from '../src/utils/authorizationUtils';
import { sign } from 'jsonwebtoken';
import { Keypair } from '@solana/web3.js';

// eslint:disable-next-line
export const serverUrl = 'http://localhost:3041';
Expand Down

0 comments on commit d165b3a

Please sign in to comment.