diff --git a/e2e/health-checks/disk.health.e2e-spec.ts b/e2e/health-checks/disk.health.e2e-spec.ts index 94a3a51d1..61eabb833 100644 --- a/e2e/health-checks/disk.health.e2e-spec.ts +++ b/e2e/health-checks/disk.health.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/health-check.e2e-spec.ts b/e2e/health-checks/health-check.e2e-spec.ts index 8b531c5d9..ae2dc4f74 100644 --- a/e2e/health-checks/health-check.e2e-spec.ts +++ b/e2e/health-checks/health-check.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/http.health.e2e-spec.ts b/e2e/health-checks/http.health.e2e-spec.ts index 33d08dc08..54bf2c536 100644 --- a/e2e/health-checks/http.health.e2e-spec.ts +++ b/e2e/health-checks/http.health.e2e-spec.ts @@ -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`, () => { diff --git a/e2e/health-checks/memory.health.e2e-spec.ts b/e2e/health-checks/memory.health.e2e-spec.ts index b99133289..fb1fb9c7b 100644 --- a/e2e/health-checks/memory.health.e2e-spec.ts +++ b/e2e/health-checks/memory.health.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/microservice.health.e2e-spec.ts b/e2e/health-checks/microservice.health.e2e-spec.ts index 90325d597..d6a5fc5dd 100644 --- a/e2e/health-checks/microservice.health.e2e-spec.ts +++ b/e2e/health-checks/microservice.health.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/mikro-orm.health.e2e-spec.ts b/e2e/health-checks/mikro-orm.health.e2e-spec.ts index ba120a841..87da64a9c 100644 --- a/e2e/health-checks/mikro-orm.health.e2e-spec.ts +++ b/e2e/health-checks/mikro-orm.health.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/mongoose.health.e2e-spec.ts b/e2e/health-checks/mongoose.health.e2e-spec.ts index 9510e2bb2..a07d85fda 100644 --- a/e2e/health-checks/mongoose.health.e2e-spec.ts +++ b/e2e/health-checks/mongoose.health.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/prisma.health.e2e-spec.ts b/e2e/health-checks/prisma.health.e2e-spec.ts index 2ceb7b27e..c2e5c1b29 100644 --- a/e2e/health-checks/prisma.health.e2e-spec.ts +++ b/e2e/health-checks/prisma.health.e2e-spec.ts @@ -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); diff --git a/e2e/health-checks/sequelize.health.e2e-spec.ts b/e2e/health-checks/sequelize.health.e2e-spec.ts index 67381ff70..0923aab67 100644 --- a/e2e/health-checks/sequelize.health.e2e-spec.ts +++ b/e2e/health-checks/sequelize.health.e2e-spec.ts @@ -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; diff --git a/e2e/health-checks/typeorm.health.e2e-spec.ts b/e2e/health-checks/typeorm.health.e2e-spec.ts index d6ab9e0c9..225e4c7c0 100644 --- a/e2e/health-checks/typeorm.health.e2e-spec.ts +++ b/e2e/health-checks/typeorm.health.e2e-spec.ts @@ -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; diff --git a/e2e/helper/bootstrap-microservice.ts b/e2e/helper/bootstrap-microservice.ts index d47eb6268..fd7da32df 100644 --- a/e2e/helper/bootstrap-microservice.ts +++ b/e2e/helper/bootstrap-microservice.ts @@ -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'; diff --git a/e2e/helper/bootstrap-remote-server.ts b/e2e/helper/bootstrap-remote-server.ts index 73dbeaf5a..8e72c60f7 100644 --- a/e2e/helper/bootstrap-remote-server.ts +++ b/e2e/helper/bootstrap-remote-server.ts @@ -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 extends PromiseLike ? U : T; diff --git a/e2e/helper/bootstrap-testing-module.ts b/e2e/helper/bootstrap-testing-module.ts index d6b734a6d..055399b4a 100644 --- a/e2e/helper/bootstrap-testing-module.ts +++ b/e2e/helper/bootstrap-testing-module.ts @@ -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, @@ -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; diff --git a/package.json b/package.json index fd57ce8b5..79227b8ad 100644 --- a/package.json +++ b/package.json @@ -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", @@ -290,8 +291,7 @@ }, { "files": [ - "*.spec.ts", - "*.e2e-spec.ts" + "*.spec.ts" ], "env": { "jest": true diff --git a/tools/gulp/config.ts b/tools/gulp/config.ts index 729149d94..d59bbf672 100644 --- a/tools/gulp/config.ts +++ b/tools/gulp/config.ts @@ -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, '../../'); diff --git a/tools/gulp/tasks/clean.ts b/tools/gulp/tasks/clean.ts index 73009957b..ec6bfd374 100644 --- a/tools/gulp/tasks/clean.ts +++ b/tools/gulp/tasks/clean.ts @@ -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 diff --git a/tools/gulp/tasks/move.ts b/tools/gulp/tasks/move.ts index defc0ba14..111abef97 100644 --- a/tools/gulp/tasks/move.ts +++ b/tools/gulp/tasks/move.ts @@ -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'; diff --git a/tools/gulp/tasks/samples.ts b/tools/gulp/tasks/samples.ts index 89c8e68aa..bda87e1d7 100644 --- a/tools/gulp/tasks/samples.ts +++ b/tools/gulp/tasks/samples.ts @@ -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'; diff --git a/tools/import-check.ts b/tools/import-check.ts index ae2663033..e68cc368f 100644 --- a/tools/import-check.ts +++ b/tools/import-check.ts @@ -67,6 +67,7 @@ rollup({ } }) .catch((err) => { + // eslint-disable-next-line no-console console.error(err); process.exit(1); });