Skip to content

Commit

Permalink
style: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
micalevisk committed Feb 6, 2024
1 parent 4c89de4 commit be2f7e6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
36 changes: 19 additions & 17 deletions actions/info.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export class InfoAction extends AbstractAction {

private async displaySystemInformation(): Promise<void> {
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();
}
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion lib/compiler/defaults/swc-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const swcDefaultsFactory = (

return {
swcOptions: {
sourceMaps: tsOptions?.sourceMap || (tsOptions?.inlineSourceMap && 'inline'),
sourceMaps:
tsOptions?.sourceMap || (tsOptions?.inlineSourceMap && 'inline'),
module: {
type: 'commonjs',
},
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/os-info.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export default function osName(platform: string, release: string): string {
case 'android':
return 'Android';
default:
return platform;
return platform;
}
}
}
1 change: 0 additions & 1 deletion test/actions/info.action.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ describe('InfoAction', () => {
name: 'websockets',
value: '^2.*&1.0',
},

{
name: 'platform-socket.io',
packageName: '@nestjs/platform-socket.io',
Expand Down

0 comments on commit be2f7e6

Please sign in to comment.