Skip to content

Commit 41e8fcc

Browse files
authored
Merge pull request #125 from Chrilleweb/cmn/dev
Moved healthscore down on output
2 parents c9c847c + bb57e28 commit 41e8fcc

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semant
1212
### Changed
1313

1414
- Updated dependencies to latest versions.
15+
- Moved `healthScore` further down on the console output for better visibility of issues.
1516

1617
### Fixed
1718

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dotenv-diff",
3-
"version": "2.3.11",
3+
"version": "2.3.12",
44
"type": "module",
55
"description": "Detects environment variable issues, usage, and potential security risks.",
66
"bin": {

src/config/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ export interface ScanJsonEntry {
190190
uniqueVariables: number;
191191
duration: number;
192192
};
193-
healthScore: number;
194193
missing: Array<{
195194
variable: string;
196195
usages: Array<{
@@ -246,6 +245,7 @@ export interface ScanJsonEntry {
246245
file: string;
247246
line: number;
248247
}>;
248+
healthScore?: number;
249249
}
250250

251251
// Type for grouped usages by variable

src/core/scanJsonOutput.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export function createJsonOutput(
3737

3838
const output: ScanJsonEntry = {
3939
stats: scanResult.stats,
40-
healthScore,
4140
missing: missingGrouped,
4241
unused: scanResult.unused,
4342
};
@@ -98,5 +97,7 @@ export function createJsonOutput(
9897
}));
9998
}
10099

100+
output.healthScore = healthScore;
101+
101102
return output;
102103
}

src/services/scanOutputToConsole.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ export function outputToConsole(
5454
// Show stats if requested
5555
printStats(scanResult.stats, isJson, opts.showStats ?? true);
5656

57-
const score = computeHealthScore(scanResult);
58-
printHealthScore(score);
59-
6057
// Show used variables if any found
6158
if (scanResult.stats.uniqueVariables > 0) {
6259
// Show unique variables found
@@ -219,6 +216,10 @@ export function outputToConsole(
219216
);
220217
}
221218

219+
// Health score
220+
const score = computeHealthScore(scanResult);
221+
printHealthScore(score);
222+
222223
// Filtered results for fix tips
223224
printFixTips(
224225
{

0 commit comments

Comments
 (0)