diff --git a/lib/errors/connection-not-found.error.ts b/lib/errors/connection-not-found.error.ts index 0e4692a52..8b92fb579 100644 --- a/lib/errors/connection-not-found.error.ts +++ b/lib/errors/connection-not-found.error.ts @@ -1,5 +1,5 @@ -import { HealthCheckError } from '../health-check/health-check.error'; import { CONNECTION_NOT_FOUND } from './messages.constant'; +import { HealthCheckError } from '../health-check/health-check.error'; /** * Error which gets thrown when the connection diff --git a/lib/errors/storage-exceeded.error.ts b/lib/errors/storage-exceeded.error.ts index 2c1e16d82..8fae05ad0 100644 --- a/lib/errors/storage-exceeded.error.ts +++ b/lib/errors/storage-exceeded.error.ts @@ -1,5 +1,5 @@ -import { HealthCheckError } from '../health-check/health-check.error'; import { STORAGE_EXCEEDED } from './messages.constant'; +import { HealthCheckError } from '../health-check/health-check.error'; /** * Error which gets thrown when the given storage threshold diff --git a/lib/errors/timeout-error.ts b/lib/errors/timeout-error.ts index ba287d772..64c78b36c 100644 --- a/lib/errors/timeout-error.ts +++ b/lib/errors/timeout-error.ts @@ -1,5 +1,5 @@ -import { HealthCheckError } from '../health-check/health-check.error'; import { TIMEOUT_EXCEEDED } from './messages.constant'; +import { HealthCheckError } from '../health-check/health-check.error'; /** * Gets thrown when the timeout of the health check exceeds diff --git a/lib/errors/unhealthy-response-code.error.ts b/lib/errors/unhealthy-response-code.error.ts index d884f4ba1..8aeeda6e6 100644 --- a/lib/errors/unhealthy-response-code.error.ts +++ b/lib/errors/unhealthy-response-code.error.ts @@ -1,5 +1,5 @@ -import { HealthCheckError } from '../health-check/health-check.error'; import { UNHEALTHY_RESPONSE_CODE } from './messages.constant'; +import { HealthCheckError } from '../health-check/health-check.error'; /** * Error which gets thrown when the terminus client receives diff --git a/lib/health-check/error-logger/error-logger.provider.ts b/lib/health-check/error-logger/error-logger.provider.ts index 128a23009..c56495976 100644 --- a/lib/health-check/error-logger/error-logger.provider.ts +++ b/lib/health-check/error-logger/error-logger.provider.ts @@ -1,8 +1,8 @@ import { Provider } from '@nestjs/common'; -import { ErrorLogStyle } from '../../terminus-options.interface'; import { ErrorLogger } from './error-logger.interface'; import { JsonErrorLogger } from './json-error-logger.service'; import { PrettyErrorLogger } from './pretty-error-logger.service'; +import { ErrorLogStyle } from '../../terminus-options.interface'; export const ERROR_LOGGER = 'TERMINUS_ERROR_LOGGER'; diff --git a/lib/health-check/error-logger/pretty-error-logger.service.ts b/lib/health-check/error-logger/pretty-error-logger.service.ts index 59dd6b907..5745f743e 100644 --- a/lib/health-check/error-logger/pretty-error-logger.service.ts +++ b/lib/health-check/error-logger/pretty-error-logger.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { HealthIndicatorResult } from '../../health-indicator'; -import { ErrorLogger } from './error-logger.interface'; import * as boxen from 'boxen'; +import { ErrorLogger } from './error-logger.interface'; +import { HealthIndicatorResult } from '../../health-indicator'; const GREEN = '\x1b[0m\x1b[32m'; const RED = '\x1b[0m\x1b[31m'; diff --git a/lib/health-check/health-check-executor.service.ts b/lib/health-check/health-check-executor.service.ts index 2c6e6310b..5faab4cf9 100644 --- a/lib/health-check/health-check-executor.service.ts +++ b/lib/health-check/health-check-executor.service.ts @@ -1,13 +1,13 @@ import { Injectable, BeforeApplicationShutdown } from '@nestjs/common'; -import { - HealthIndicatorFunction, - HealthIndicatorResult, -} from '../health-indicator'; -import { HealthCheckError } from '../health-check/health-check.error'; import { HealthCheckResult, HealthCheckStatus, } from './health-check-result.interface'; +import { HealthCheckError } from '../health-check/health-check.error'; +import { + HealthIndicatorFunction, + HealthIndicatorResult, +} from '../health-indicator'; import { isHealthCheckError } from '../utils'; /** diff --git a/lib/health-check/health-check.service.ts b/lib/health-check/health-check.service.ts index d151a50aa..7f6c164cb 100644 --- a/lib/health-check/health-check.service.ts +++ b/lib/health-check/health-check.service.ts @@ -5,12 +5,12 @@ import { ConsoleLogger, LoggerService, } from '@nestjs/common'; -import { HealthIndicatorFunction } from '../health-indicator'; import { ErrorLogger } from './error-logger/error-logger.interface'; import { ERROR_LOGGER } from './error-logger/error-logger.provider'; import { HealthCheckExecutor } from './health-check-executor.service'; import { HealthCheckResult } from './health-check-result.interface'; import { TERMINUS_LOGGER } from './logger/logger.provider'; +import { HealthIndicatorFunction } from '../health-indicator'; /** * Handles Health Checks which can be used in diff --git a/lib/health-indicator/database/mikro-orm.health.ts b/lib/health-indicator/database/mikro-orm.health.ts index 10d578997..dd90fbe8c 100644 --- a/lib/health-indicator/database/mikro-orm.health.ts +++ b/lib/health-indicator/database/mikro-orm.health.ts @@ -1,15 +1,14 @@ +import * as MikroOrm from '@mikro-orm/core'; import { Injectable, Scope } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; -import { HealthCheckError } from '../../health-check'; - -import * as MikroOrm from '@mikro-orm/core'; +import { HealthIndicator, HealthIndicatorResult } from '..'; import { TimeoutError } from '../../errors'; +import { HealthCheckError } from '../../health-check'; import { TimeoutError as PromiseTimeoutError, promiseTimeout, checkPackages, } from '../../utils'; -import { HealthIndicator, HealthIndicatorResult } from '..'; export interface MikroOrmPingCheckSettings { /** diff --git a/lib/health-indicator/database/mongoose.health.ts b/lib/health-indicator/database/mongoose.health.ts index 649f22d48..ed3b73e11 100644 --- a/lib/health-indicator/database/mongoose.health.ts +++ b/lib/health-indicator/database/mongoose.health.ts @@ -1,19 +1,17 @@ import { Injectable, Scope } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; -import { HealthCheckError } from '../../health-check/health-check.error'; - import * as NestJSMongoose from '@nestjs/mongoose'; - -import { - promiseTimeout, - TimeoutError as PromiseTimeoutError, - checkPackages, -} from '../../utils'; import { HealthIndicatorResult, TimeoutError, ConnectionNotFoundError, } from '../..'; +import { HealthCheckError } from '../../health-check/health-check.error'; +import { + promiseTimeout, + TimeoutError as PromiseTimeoutError, + checkPackages, +} from '../../utils'; import { HealthIndicator } from '../health-indicator'; export interface MongoosePingCheckSettings { diff --git a/lib/health-indicator/database/prisma.health.ts b/lib/health-indicator/database/prisma.health.ts index ff7073710..e0fa9c74e 100644 --- a/lib/health-indicator/database/prisma.health.ts +++ b/lib/health-indicator/database/prisma.health.ts @@ -1,11 +1,11 @@ +import { Injectable } from '@nestjs/common'; +import { TimeoutError } from '../../errors'; +import { HealthCheckError } from '../../health-check'; import { promiseTimeout, TimeoutError as PromiseTimeoutError, } from '../../utils'; import { HealthIndicator } from '../health-indicator'; -import { TimeoutError } from '../../errors'; -import { HealthCheckError } from '../../health-check'; -import { Injectable } from '@nestjs/common'; type PingCommandSignature = { [Key in string]?: number }; diff --git a/lib/health-indicator/database/sequelize.health.ts b/lib/health-indicator/database/sequelize.health.ts index 930544dfe..2b4acbea8 100644 --- a/lib/health-indicator/database/sequelize.health.ts +++ b/lib/health-indicator/database/sequelize.health.ts @@ -1,18 +1,17 @@ import { Injectable, Scope } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; -import { HealthCheckError } from '../../health-check/health-check.error'; import * as NestJSSequelize from '@nestjs/sequelize'; - -import { - promiseTimeout, - TimeoutError as PromiseTimeoutError, - checkPackages, -} from '../../utils'; import { HealthIndicatorResult, TimeoutError, ConnectionNotFoundError, } from '../..'; +import { HealthCheckError } from '../../health-check/health-check.error'; +import { + promiseTimeout, + TimeoutError as PromiseTimeoutError, + checkPackages, +} from '../../utils'; import { HealthIndicator } from '../health-indicator'; export interface SequelizePingCheckSettings { diff --git a/lib/health-indicator/database/typeorm.health.ts b/lib/health-indicator/database/typeorm.health.ts index 3f80bef23..bd57533ca 100644 --- a/lib/health-indicator/database/typeorm.health.ts +++ b/lib/health-indicator/database/typeorm.health.ts @@ -1,21 +1,19 @@ import { Injectable, Scope } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; -import { HealthCheckError } from '../../health-check/health-check.error'; - -import * as TypeOrm from 'typeorm'; import * as NestJSTypeOrm from '@nestjs/typeorm'; - +import * as TypeOrm from 'typeorm'; +import { HealthIndicator, HealthIndicatorResult } from '../'; import { TimeoutError, ConnectionNotFoundError, MongoConnectionError, } from '../../errors'; +import { HealthCheckError } from '../../health-check/health-check.error'; import { TimeoutError as PromiseTimeoutError, promiseTimeout, checkPackages, } from '../../utils'; -import { HealthIndicator, HealthIndicatorResult } from '../'; export interface TypeOrmPingCheckSettings { /** diff --git a/lib/health-indicator/disk/disk-usage-lib.provider.ts b/lib/health-indicator/disk/disk-usage-lib.provider.ts index 604cf16b3..48935581d 100644 --- a/lib/health-indicator/disk/disk-usage-lib.provider.ts +++ b/lib/health-indicator/disk/disk-usage-lib.provider.ts @@ -1,6 +1,6 @@ +import checkDiskSpace from 'check-disk-space'; import { CHECK_DISK_SPACE_LIB } from '../../terminus.constants'; -import checkDiskSpace from 'check-disk-space'; /** * Wrapper of the check-disk-space library. diff --git a/lib/health-indicator/disk/disk.health.ts b/lib/health-indicator/disk/disk.health.ts index 0f4e0ef25..125ccc526 100644 --- a/lib/health-indicator/disk/disk.health.ts +++ b/lib/health-indicator/disk/disk.health.ts @@ -1,15 +1,14 @@ import { Injectable, Inject } from '@nestjs/common'; import { isNil } from '@nestjs/common/utils/shared.utils'; import checkDiskSpace from 'check-disk-space'; - -import { HealthIndicator, HealthIndicatorResult } from '../'; -import { CHECK_DISK_SPACE_LIB } from '../../terminus.constants'; -import { StorageExceededError } from '../../errors'; -import { STORAGE_EXCEEDED } from '../../errors/messages.constant'; import { DiskHealthIndicatorOptions, DiskOptionsWithThresholdPercent, } from './disk-health-options.type'; +import { HealthIndicator, HealthIndicatorResult } from '../'; +import { StorageExceededError } from '../../errors'; +import { STORAGE_EXCEEDED } from '../../errors/messages.constant'; +import { CHECK_DISK_SPACE_LIB } from '../../terminus.constants'; type CheckDiskSpace = typeof checkDiskSpace; diff --git a/lib/health-indicator/health-indicators.provider.ts b/lib/health-indicator/health-indicators.provider.ts index f1aca28d8..4e5ce5b11 100644 --- a/lib/health-indicator/health-indicators.provider.ts +++ b/lib/health-indicator/health-indicators.provider.ts @@ -1,5 +1,4 @@ import { Type } from '@nestjs/common'; - import { TypeOrmHealthIndicator, HttpHealthIndicator, diff --git a/lib/health-indicator/http/http.health.ts b/lib/health-indicator/http/http.health.ts index ae37184c5..7f4cc6bdb 100644 --- a/lib/health-indicator/http/http.health.ts +++ b/lib/health-indicator/http/http.health.ts @@ -1,14 +1,14 @@ +import { URL } from 'url'; +import type * as NestJSAxios from '@nestjs/axios'; import { ConsoleLogger, Inject, Injectable, Scope } from '@nestjs/common'; -import { HealthIndicator, HealthIndicatorResult } from '..'; -import { HealthCheckError } from '../../health-check/health-check.error'; -import { lastValueFrom, Observable } from 'rxjs'; import { ModuleRef } from '@nestjs/core'; -import { checkPackages, isAxiosError } from '../../utils'; -import type * as NestJSAxios from '@nestjs/axios'; +import { lastValueFrom, Observable } from 'rxjs'; import { AxiosRequestConfig, AxiosResponse } from './axios.interfaces'; -import { URL } from 'url'; +import { HealthIndicator, HealthIndicatorResult } from '..'; import { AxiosError } from '../../errors/axios.error'; +import { HealthCheckError } from '../../health-check/health-check.error'; import { TERMINUS_LOGGER } from '../../health-check/logger/logger.provider'; +import { checkPackages, isAxiosError } from '../../utils'; interface HttpClientLike { request(config: any): Observable>; diff --git a/lib/health-indicator/memory/memory.health.ts b/lib/health-indicator/memory/memory.health.ts index 3a1e81e31..08b0d58aa 100644 --- a/lib/health-indicator/memory/memory.health.ts +++ b/lib/health-indicator/memory/memory.health.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { HealthIndicator, HealthIndicatorResult } from '../'; -import { STORAGE_EXCEEDED } from '../../errors/messages.constant'; import { StorageExceededError } from '../../errors'; +import { STORAGE_EXCEEDED } from '../../errors/messages.constant'; /** * The MemoryHealthIndicator contains checks which are related diff --git a/lib/health-indicator/microservice/grpc.health.ts b/lib/health-indicator/microservice/grpc.health.ts index 011056ac9..ae745c200 100644 --- a/lib/health-indicator/microservice/grpc.health.ts +++ b/lib/health-indicator/microservice/grpc.health.ts @@ -1,13 +1,13 @@ -import { HealthCheckError } from '../../health-check/health-check.error'; +import { join } from 'path'; import { Injectable, Scope } from '@nestjs/common'; import type * as NestJSMicroservices from '@nestjs/microservices'; -import { join } from 'path'; import { Observable, lastValueFrom } from 'rxjs'; import { HealthIndicatorResult, TimeoutError, UnhealthyResponseCodeError, } from '../..'; +import { HealthCheckError } from '../../health-check/health-check.error'; import { checkPackages, isError, diff --git a/lib/health-indicator/microservice/microservice.health.ts b/lib/health-indicator/microservice/microservice.health.ts index 03100e1c2..9f4c63358 100644 --- a/lib/health-indicator/microservice/microservice.health.ts +++ b/lib/health-indicator/microservice/microservice.health.ts @@ -1,7 +1,8 @@ -import { HealthCheckError } from '../../health-check/health-check.error'; import { Injectable, Scope } from '@nestjs/common'; import * as NestJSMicroservices from '@nestjs/microservices'; +import { HealthIndicator, HealthIndicatorResult } from '../'; import { TimeoutError } from '../../errors'; +import { HealthCheckError } from '../../health-check/health-check.error'; import { checkPackages, promiseTimeout, @@ -9,7 +10,6 @@ import { PropType, isError, } from '../../utils'; -import { HealthIndicator, HealthIndicatorResult } from '../'; // Since @nestjs/microservices is lazily loaded we are not able to use // its types. It would end up in the d.ts file if we would use the types. diff --git a/lib/terminus.module.ts b/lib/terminus.module.ts index 9e3c883f0..5cfe47fc1 100644 --- a/lib/terminus.module.ts +++ b/lib/terminus.module.ts @@ -1,12 +1,12 @@ import { DynamicModule, Module } from '@nestjs/common'; -import { DiskUsageLibProvider } from './health-indicator/disk/disk-usage-lib.provider'; -import { HEALTH_INDICATORS } from './health-indicator/health-indicators.provider'; import { HealthCheckService } from './health-check'; -import { HealthCheckExecutor } from './health-check/health-check-executor.service'; -import { ERROR_LOGGERS } from './health-check/error-logger/error-loggers.provider'; import { getErrorLoggerProvider } from './health-check/error-logger/error-logger.provider'; -import { TerminusModuleOptions } from './terminus-options.interface'; +import { ERROR_LOGGERS } from './health-check/error-logger/error-loggers.provider'; +import { HealthCheckExecutor } from './health-check/health-check-executor.service'; import { getLoggerProvider } from './health-check/logger/logger.provider'; +import { DiskUsageLibProvider } from './health-indicator/disk/disk-usage-lib.provider'; +import { HEALTH_INDICATORS } from './health-indicator/health-indicators.provider'; +import { TerminusModuleOptions } from './terminus-options.interface'; const providers = [ ...ERROR_LOGGERS, diff --git a/lib/utils/is-error.ts b/lib/utils/is-error.ts index 8258c0f6d..37777c15c 100644 --- a/lib/utils/is-error.ts +++ b/lib/utils/is-error.ts @@ -1,5 +1,5 @@ -import { AxiosError } from '../errors/axios.error'; import { HealthCheckError } from '../'; +import { AxiosError } from '../errors/axios.error'; export function isHealthCheckError(err: any): err is HealthCheckError { return err?.isHealthCheckError; diff --git a/package-lock.json b/package-lock.json index d35eb003f..a3413de11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,8 +47,9 @@ "delete-empty": "3.0.0", "eslint": "8.45.0", "eslint-config-prettier": "8.8.0", + "eslint-import-resolver-typescript": "^3.6.0", "eslint-plugin-deprecation": "^2.0.0", - "eslint-plugin-import": "2.27.5", + "eslint-plugin-import": "^2.27.5", "fastify": "4.20.0", "gulp": "4.0.2", "gulp-clean": "0.4.0", @@ -7549,6 +7550,19 @@ "once": "^1.4.0" } }, + "node_modules/enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -7938,18 +7952,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-import-resolver-node/node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/eslint-import-resolver-node/node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -7967,6 +7969,31 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.0.tgz", + "integrity": "sha512-QTHR9ddNnn35RTxlaEnx2gCxqFlF2SEN0SE2d17SqwyM7YOSI2GHWRYp5BiRkObTUNYPupC/3Fq2a0PpT+EKpg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, "node_modules/eslint-module-utils": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", @@ -8172,18 +8199,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/eslint-plugin-import/node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -8733,9 +8748,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -9745,6 +9760,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.0.tgz", + "integrity": "sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/get-uri": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.1.tgz", @@ -11698,9 +11725,9 @@ } }, "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -18161,6 +18188,15 @@ "node": ">= 0.10" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -19626,6 +19662,15 @@ "integrity": "sha512-2LKVuU2m6RHkemJloKiKJOTpN2RPmbsiad0OfSdtmFHOXJKAgYRZMwJcpT96RX6E9HUB5RkVOFC6vWqVjRgSOg==", "dev": true }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/tarn": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz", @@ -27224,6 +27269,16 @@ "once": "^1.4.0" } }, + "enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -27577,15 +27632,6 @@ "ms": "^2.1.1" } }, - "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -27599,6 +27645,21 @@ } } }, + "eslint-import-resolver-typescript": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.0.tgz", + "integrity": "sha512-QTHR9ddNnn35RTxlaEnx2gCxqFlF2SEN0SE2d17SqwyM7YOSI2GHWRYp5BiRkObTUNYPupC/3Fq2a0PpT+EKpg==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + } + }, "eslint-module-utils": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", @@ -27738,15 +27799,6 @@ "esutils": "^2.0.2" } }, - "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -28154,9 +28206,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -28974,6 +29026,15 @@ "get-intrinsic": "^1.1.1" } }, + "get-tsconfig": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.0.tgz", + "integrity": "sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "get-uri": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.1.tgz", @@ -30496,9 +30557,9 @@ } }, "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "requires": { "has": "^1.0.3" @@ -35365,6 +35426,12 @@ "value-or-function": "^3.0.0" } }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -36474,6 +36541,12 @@ "integrity": "sha512-2LKVuU2m6RHkemJloKiKJOTpN2RPmbsiad0OfSdtmFHOXJKAgYRZMwJcpT96RX6E9HUB5RkVOFC6vWqVjRgSOg==", "dev": true }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true + }, "tarn": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz", diff --git a/package.json b/package.json index ccdd0d9aa..117271b63 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,9 @@ "delete-empty": "3.0.0", "eslint": "8.45.0", "eslint-config-prettier": "8.8.0", + "eslint-import-resolver-typescript": "^3.6.0", "eslint-plugin-deprecation": "^2.0.0", - "eslint-plugin-import": "2.27.5", + "eslint-plugin-import": "^2.27.5", "fastify": "4.20.0", "gulp": "4.0.2", "gulp-clean": "0.4.0", @@ -260,6 +261,8 @@ "plugin:deprecation/recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript", "prettier" ], "root": true, @@ -267,12 +270,61 @@ "node": true, "jest": true }, + "overrides": [ + { + "files": [ + "*.{js,ts}" + ], + "settings": { + "import/resolver": { + "typescript": { + "alwaysTryTypes": true, + "project": [ + "./tsconfig.json", + "./e2e/tsconfig.json" + ] + } + } + } + } + ], "rules": { "@typescript-eslint/interface-name-prefix": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-non-null-assertion": "off" + "@typescript-eslint/no-non-null-assertion": "off", + "import/newline-after-import": 2, + "import/order": [ + 2, + { + "groups": [ + "builtin", + "external", + "internal", + [ + "parent", + "sibling", + "index" + ] + ], + "pathGroups": [ + { + "pattern": "@nestjs*", + "group": "external", + "position": "before" + } + ], + "distinctGroup": false, + "alphabetize": { + "order": "asc", + "orderImportKind": "asc", + "caseInsensitive": true + }, + "newlines-between": "never", + "pathGroupsExcludedImportTypes": [] + } + ] } } }