Registry /
testing / prettier-linter-helpers
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
showInvisibles
✓ import { showInvisibles } from 'prettier-linter-helpers'
✗ const showInvisibles = require('prettier-linter-helpers').showInvisibles
ESM import works in Node >=12; CommonJS require also works as package supports both.
generateDifferences
✓ import { generateDifferences } from 'prettier-linter-helpers'
✗ import generateDifferences from 'prettier-linter-helpers'
This is a named export, not default. CommonJS: const { generateDifferences } = require('prettier-linter-helpers').
package
✓ import * as helpers from 'prettier-linter-helpers'
✗ const helpers = require('prettier-linter-helpers'); helpers.default.showInvisibles
There is no default export; use namespace import if you want both.
types
✓ import type { Difference } from 'prettier-linter-helpers'
TypeScript types are included; 'Difference' is the type of items in the array returned by generateDifferences.
Imports the two helper functions, shows use of showInvisibles to make whitespace visible, and generateDifferences to compare two strings.
import { showInvisibles, generateDifferences } from 'prettier-linter-helpers';
const source = 'const x = 1;\n';
const prettierSource = 'const x = 1;\n';
// Show invisible characters (tab, space, newline)
const visible = showInvisibles(source);
console.log(visible);
// 'const x = 1;·\n'
// Generate differences between source and prettierSource
const diffs = generateDifferences(source, prettierSource);
console.log(diffs);
// []
// Example with a difference
const source2 = 'const x = 1';
const prettierSource2 = 'const x = 1;\n';
const diffs2 = generateDifferences(source2, prettierSource2);
console.log(diffs2);
// [ { offset: 11, operation: 'insert', insertText: ';\n' } ]
Errors
Common errors & fixes
TypeError: (0 , prettier_linter_helpers.showInvisibles) is not a function
Using CommonJS require incorrectly with ES module bundlers like Webpack.
fixChange to: import { showInvisibles } from 'prettier-linter-helpers' Module not found: Can't resolve 'prettier-linter-helpers'
Package not installed or not in node_modules.
fixRun: npm install prettier-linter-helpers
Cannot read property 'showInvisibles' of undefined
Attempting to access a named export as a property of the default export.
fixUse named import: import { showInvisibles } from 'prettier-linter-helpers' Audit
Dependencies
No dependency data recorded yet.