Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunnerLivio committed Nov 26, 2023
1 parent 1d22928 commit 709a155
Show file tree
Hide file tree
Showing 19 changed files with 76 additions and 55 deletions.
10 changes: 6 additions & 4 deletions e2e/health-checks/disk.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import { type INestApplication } from '@nestjs/common';
import checkDiskSpace from 'check-disk-space';

import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import * as request from 'supertest';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';

describe('DiskHealthIndicator', () => {
let app: INestApplication;
Expand Down
9 changes: 6 additions & 3 deletions e2e/health-checks/health-check.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import { DynamicHealthEndpointFn, bootstrapTestingModule } from '../helper';
import { HealthIndicatorResult } from '../../lib';
import { type HealthIndicatorResult } from '../../lib';
import {
type DynamicHealthEndpointFn,
bootstrapTestingModule,
} from '../helper';

describe.only('HealthCheck', () => {
let app: INestApplication;
Expand Down
7 changes: 3 additions & 4 deletions e2e/health-checks/http.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';

import {
bootstrapRemoteServer,
bootstrapTestingModule,
DynamicHealthEndpointFn,
DynamicRemoteServerFn,
type DynamicHealthEndpointFn,
type DynamicRemoteServerFn,
} from '../helper';

describe(`HttpHealthIndicator`, () => {
Expand Down
8 changes: 5 additions & 3 deletions e2e/health-checks/memory.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';

import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';

describe('MemoryHealthIndicator', () => {
let app: INestApplication;
Expand Down
16 changes: 8 additions & 8 deletions e2e/health-checks/microservice.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { type INestApplication, type INestMicroservice } from '@nestjs/common';
import {
type KafkaOptions,
type RmqOptions,
type TcpClientOptions,
Transport,
} from '@nestjs/microservices';
import * as request from 'supertest';
import { INestApplication, INestMicroservice } from '@nestjs/common';
import {
bootstrapMicroservice,
bootstrapTestingModule,
DynamicHealthEndpointFn,
type DynamicHealthEndpointFn,
} from '../helper';
import {
KafkaOptions,
RmqOptions,
TcpClientOptions,
Transport,
} from '@nestjs/microservices';

describe('MicroserviceHealthIndicator', () => {
let app: INestApplication;
Expand Down
7 changes: 5 additions & 2 deletions e2e/health-checks/mikro-orm.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';

describe('MikroOrmHealthIndicator', () => {
let app: INestApplication;
Expand Down
7 changes: 5 additions & 2 deletions e2e/health-checks/mongoose.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';

describe('MongooseHealthIndicator', () => {
let app: INestApplication;
Expand Down
9 changes: 6 additions & 3 deletions e2e/health-checks/prisma.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { INestApplication } from '@nestjs/common';
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';
import { PrismaClient as MongoPrismaClient } from '../prisma/generated/mongodb';
import { PrismaClient as MySQLPrismaClient } from '../prisma/generated/mysql';
import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import * as request from 'supertest';

jest.setTimeout(300_000);

Expand Down
7 changes: 5 additions & 2 deletions e2e/health-checks/sequelize.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';

describe('SequelizeHealthIndicator', () => {
let app: INestApplication;
Expand Down
7 changes: 5 additions & 2 deletions e2e/health-checks/typeorm.health.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import { bootstrapTestingModule, DynamicHealthEndpointFn } from '../helper';
import {
bootstrapTestingModule,
type DynamicHealthEndpointFn,
} from '../helper';

describe('TypeOrmHealthIndicator', () => {
let app: INestApplication;
Expand Down
2 changes: 1 addition & 1 deletion e2e/helper/bootstrap-microservice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { INestMicroservice, Module } from '@nestjs/common';
import { type INestMicroservice, Module } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { Transport } from '@nestjs/microservices';
import * as waitPort from 'wait-port';
Expand Down
2 changes: 1 addition & 1 deletion e2e/helper/bootstrap-remote-server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Server } from 'http';
import * as express from 'express';
import { Server } from 'http';
import * as portfinder from 'portfinder';

type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
Expand Down
21 changes: 10 additions & 11 deletions e2e/helper/bootstrap-testing-module.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { HttpModule } from '@nestjs/axios';
import {
Controller,
Get,
INestApplication,
ModuleMetadata,
type INestApplication,
type ModuleMetadata,
} from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { FastifyAdapter } from '@nestjs/platform-fastify';
import { MongooseModule } from '@nestjs/mongoose';
import { ExpressAdapter } from '@nestjs/platform-express';
import { type FastifyAdapter } from '@nestjs/platform-fastify';
import { SequelizeModule } from '@nestjs/sequelize';
import { Test } from '@nestjs/testing';
import { TypeOrmModule } from '@nestjs/typeorm';

import {
DiskHealthIndicator,
HealthCheck,
HealthCheckResult,
type HealthCheckResult,
HealthCheckService,
HttpHealthIndicator,
MemoryHealthIndicator,
Expand All @@ -23,12 +26,8 @@ import {
TerminusModule,
TypeOrmHealthIndicator,
} from '../../lib';
import { SequelizeModule } from '@nestjs/sequelize';
import { MongooseModule } from '@nestjs/mongoose';
import { HttpModule } from '@nestjs/axios';
import { type HealthCheckOptions } from '../../lib/health-check';
import { MikroOrmHealthIndicator } from '../../lib/health-indicator/database/mikro-orm.health';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { HealthCheckOptions } from '../../lib/health-check';

type TestingHealthFunc = (props: {
healthCheck: HealthCheckService;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"clean": "gulp clean",
"format": "prettier --write \"{lib,e2e,sample,tools}/**/*.ts\"",
"format:check": "prettier --check \"{lib,e2e,sample,tools}/**/*.ts\"",
"lint": "eslint \"lib/**/*.ts\" --fix",
"lint": "eslint \"lib/**/*.ts\"",
"lint:fix": "eslint \"lib/**/*.ts\" \"e2e/**/*.ts\" \"tools/**/*.ts\" --fix",
"precommit": "lint-staged",
"prepublish": "npm run build",
"prepublish:next": "npm run build",
Expand Down Expand Up @@ -290,8 +291,7 @@
},
{
"files": [
"*.spec.ts",
"*.e2e-spec.ts"
"*.spec.ts"
],
"env": {
"jest": true
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getDirs } from './util/task-helpers';
import { join } from 'path';
import { getDirs } from './util/task-helpers';

// All paths are related to the base dir
export const rootFolder = join(__dirname, '../../');
Expand Down
4 changes: 2 additions & 2 deletions tools/gulp/tasks/clean.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as deleteEmpty from 'delete-empty';
import { task, src, series } from 'gulp';
import { libPath } from '../config';
import * as clean from 'gulp-clean';
import * as deleteEmpty from 'delete-empty';
import { libPath } from '../config';

/**
* Cleans the build output assets from the packages folders
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/move.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dest, src, task } from 'gulp';
import { join } from 'path';
import { dest, src, task } from 'gulp';
import { samplePath, libPath, distPath } from '../config';
import { getDirs } from '../util/task-helpers';

Expand Down
4 changes: 2 additions & 2 deletions tools/gulp/tasks/samples.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as childProcess from 'child_process';
import { resolve } from 'path';
import { promisify } from 'util';
import * as clc from 'cli-color';
import * as log from 'fancy-log';
import { task, series } from 'gulp';
import { resolve } from 'path';
import { promisify } from 'util';
import { samplePath } from '../config';
import { getDirs } from '../util/task-helpers';

Expand Down
1 change: 1 addition & 0 deletions tools/import-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ rollup({
}
})
.catch((err) => {
// eslint-disable-next-line no-console
console.error(err);
process.exit(1);
});

0 comments on commit 709a155

Please sign in to comment.