Hairballs

raw JSON →
0.3.3 verified Fri May 01 auth: no javascript maintenance

Shared utilities for lint reporters, including ESLint and SCSS-Lint. Version 0.3.3 is current, with infrequent releases. Provides formatting and reporting helpers. Minimal dependencies, but some security fixes were applied in v0.3.0 for Handlebars vulnerabilities. Not widely used; primarily for internal tooling at ratherblue.

error Cannot find module 'hairballs'
cause Package not installed or not in node_modules.
fix
Run npm install hairballs.
error TypeError: hairballs.formatResults is not a function
cause Using default import instead of named import.
fix
Use import { formatResults } from 'hairballs'.
deprecated handlebars dependency had a prototype pollution vulnerability before v0.3.0
fix Update to v0.3.0 or later.
gotcha No TypeScript definitions; use with @ts-ignore or create own types.
fix Declare module or use .d.ts file.
breaking v0.3.0 updated dependencies, potentially breaking if relying on old Handlebars behavior.
fix Test reporters with new versions.
npm install hairballs
yarn add hairballs
pnpm add hairballs

Demonstrates importing formatResults and formatting a lint result object.

import { formatResults } from 'hairballs';
const results = formatResults({
  errors: [{ message: 'Unexpected var', line: 1, column: 5 }],
  warnings: []
});
console.log(results);