Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semant
### Changed

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

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dotenv-diff",
"version": "2.3.11",
"version": "2.3.12",
"type": "module",
"description": "Detects environment variable issues, usage, and potential security risks.",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export interface ScanJsonEntry {
uniqueVariables: number;
duration: number;
};
healthScore: number;
missing: Array<{
variable: string;
usages: Array<{
Expand Down Expand Up @@ -246,6 +245,7 @@ export interface ScanJsonEntry {
file: string;
line: number;
}>;
healthScore?: number;
}

// Type for grouped usages by variable
Expand Down
3 changes: 2 additions & 1 deletion src/core/scanJsonOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function createJsonOutput(

const output: ScanJsonEntry = {
stats: scanResult.stats,
healthScore,
missing: missingGrouped,
unused: scanResult.unused,
};
Expand Down Expand Up @@ -98,5 +97,7 @@ export function createJsonOutput(
}));
}

output.healthScore = healthScore;

return output;
}
7 changes: 4 additions & 3 deletions src/services/scanOutputToConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ export function outputToConsole(
// Show stats if requested
printStats(scanResult.stats, isJson, opts.showStats ?? true);

const score = computeHealthScore(scanResult);
printHealthScore(score);

// Show used variables if any found
if (scanResult.stats.uniqueVariables > 0) {
// Show unique variables found
Expand Down Expand Up @@ -219,6 +216,10 @@ export function outputToConsole(
);
}

// Health score
const score = computeHealthScore(scanResult);
printHealthScore(score);

// Filtered results for fix tips
printFixTips(
{
Expand Down
Loading