From be2f7e6356d0c8f606035cc3fbcee0ce09449b1c Mon Sep 17 00:00:00 2001 From: "Micael Levi L. Cavalcante" Date: Tue, 6 Feb 2024 14:25:23 -0400 Subject: [PATCH] style: fix formatting --- actions/info.action.ts | 36 ++++++++++++++------------- lib/compiler/defaults/swc-defaults.ts | 3 ++- lib/utils/os-info.utils.ts | 4 +-- test/actions/info.action.spec.ts | 1 - 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/actions/info.action.ts b/actions/info.action.ts index d38bfcb84..a80c92fa5 100644 --- a/actions/info.action.ts +++ b/actions/info.action.ts @@ -55,7 +55,10 @@ export class InfoAction extends AbstractAction { private async displaySystemInformation(): Promise { console.info(chalk.green('[System Information]')); - console.info('OS Version :', chalk.blue(osName(platform(), release()), release())); + console.info( + 'OS Version :', + chalk.blue(osName(platform(), release()), release()), + ); console.info('NodeJS Version :', chalk.blue(process.version)); await this.displayPackageManagerVersion(); } @@ -161,24 +164,23 @@ export class InfoAction extends AbstractAction { buildNestVersionsWarningMessage( nestDependencies: NestDependency[], ): NestDependencyWarnings { - const unsortedWarnings = - nestDependencies.reduce( - (depWarningsGroup, { name, packageName, value }) => { - if (!this.warningMessageDependenciesWhiteList.includes(packageName)) { - return depWarningsGroup; - } + const unsortedWarnings = nestDependencies.reduce( + (depWarningsGroup, { name, packageName, value }) => { + if (!this.warningMessageDependenciesWhiteList.includes(packageName)) { + return depWarningsGroup; + } - const [major,] = value.replace(/[^\d.]/g, '').split('.', 1); - const minimumVersion = major; - depWarningsGroup[minimumVersion] = [ - ...(depWarningsGroup[minimumVersion] || []), - { name, packageName, value }, - ]; + const [major] = value.replace(/[^\d.]/g, '').split('.', 1); + const minimumVersion = major; + depWarningsGroup[minimumVersion] = [ + ...(depWarningsGroup[minimumVersion] || []), + { name, packageName, value }, + ]; - return depWarningsGroup; - }, - Object.create(null) as NestDependencyWarnings, - ); + return depWarningsGroup; + }, + Object.create(null) as NestDependencyWarnings, + ); const unsortedMinorVersions = Object.keys(unsortedWarnings); if (unsortedMinorVersions.length <= 1) { diff --git a/lib/compiler/defaults/swc-defaults.ts b/lib/compiler/defaults/swc-defaults.ts index 7540246e0..a060881c3 100644 --- a/lib/compiler/defaults/swc-defaults.ts +++ b/lib/compiler/defaults/swc-defaults.ts @@ -12,7 +12,8 @@ export const swcDefaultsFactory = ( return { swcOptions: { - sourceMaps: tsOptions?.sourceMap || (tsOptions?.inlineSourceMap && 'inline'), + sourceMaps: + tsOptions?.sourceMap || (tsOptions?.inlineSourceMap && 'inline'), module: { type: 'commonjs', }, diff --git a/lib/utils/os-info.utils.ts b/lib/utils/os-info.utils.ts index 31d1b3242..bb4b966b3 100644 --- a/lib/utils/os-info.utils.ts +++ b/lib/utils/os-info.utils.ts @@ -15,6 +15,6 @@ export default function osName(platform: string, release: string): string { case 'android': return 'Android'; default: - return platform; + return platform; } -} \ No newline at end of file +} diff --git a/test/actions/info.action.spec.ts b/test/actions/info.action.spec.ts index e5ff61077..0107368b7 100644 --- a/test/actions/info.action.spec.ts +++ b/test/actions/info.action.spec.ts @@ -136,7 +136,6 @@ describe('InfoAction', () => { name: 'websockets', value: '^2.*&1.0', }, - { name: 'platform-socket.io', packageName: '@nestjs/platform-socket.io',