bahlint 28.58.69340008 → 28.58.69340009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/bahlint.js +24 -3
  2. package/package.json +1 -1
package/bin/bahlint.js CHANGED
@@ -141,13 +141,34 @@ ${getErrorMessage(error)}`;
141
141
  process.on("uncaughtException", onFatalError);
142
142
  process.on("unhandledRejection", onFatalError);
143
143
 
144
+ // Import util for styleText
145
+ const util = require("node:util");
146
+
144
147
  // Define ANSI color codes
145
148
  const RED = "\x1b[31m";
146
149
  const ORANGE = "\x1b[33m"; // or yellow
147
150
  const GREEN = "\x1b[32m";
148
- const GRAY = "\x1b[90m";
149
151
  const RESET = "\x1b[0m"; // Reset to default color
150
152
 
153
+ // Helper function to create RGB color codes
154
+ function rgbColor(r, g, b) {
155
+ return `\x1b[38;2;${r};${g};${b}m`;
156
+ }
157
+
158
+ // Define gray colors using the exact hex values provided
159
+ // #959598 -> RGB(149, 149, 152)
160
+ // #9ca3af -> RGB(156, 163, 175)
161
+ const GRAY_HEX = "#959598";
162
+ const GRAY_ALT_HEX = "#9ca3af";
163
+
164
+ // Convert hex to RGB values
165
+ const GRAY_RGB = rgbColor(149, 149, 152); // #959598
166
+ const GRAY_ALT_RGB = rgbColor(156, 163, 175); // #9ca3af
167
+
168
+ // Define color functions that use the exact hex colors via RGB
169
+ const GRAY = text => `${GRAY_RGB}${text}${RESET}`;
170
+ const GRAY_ALT = text => `${GRAY_ALT_RGB}${text}${RESET}`;
171
+
151
172
  // Show the custom startup message in red
152
173
  const { version } = require("../package.json");
153
174
  console.log(`${RED}🔥 Bahlint v${version} - Burning your code...${RESET}`);
@@ -336,7 +357,7 @@ ${getErrorMessage(error)}`;
336
357
  });
337
358
 
338
359
  if (fixedFileNames.length > 0) {
339
- console.log(`${GRAY} - ${fixedFileNames.join('\n- ')}${RESET}`);
360
+ console.log(GRAY_ALT(` - ${fixedFileNames.join('\n- ')}`));
340
361
  }
341
362
  }
342
363
  }
@@ -395,7 +416,7 @@ ${getErrorMessage(error)}`;
395
416
  // Count files scanned (all files processed, not just those with issues)
396
417
  const filesScanned = results.length;
397
418
  console.log(
398
- `${GRAY}✓ ${filesScanned} file scanned in ${(Math.random() * 0.5 + 0.2).toFixed(2)}s${RESET}`,
419
+ GRAY(`✓ ${filesScanned} file scanned in ${(Math.random() * 0.5 + 0.2).toFixed(2)}s`),
399
420
  );
400
421
 
401
422
  // Apply fixes if in fix mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bahlint",
3
- "version": "28.58.69340008",
3
+ "version": "28.58.69340009",
4
4
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
5
5
  "description": "An AST-based pattern checker for JavaScript.",
6
6
  "type": "commonjs",