{"library":"prettier-linter-helpers","title":"prettier-linter-helpers","description":"Utilities to help expose prettier output in linting tools. Version 1.0.1 provides two helper functions: showInvisibles and generateDifferences. Extracted from eslint-plugin-prettier v2.7.0, it is stable but rarely updated. Key differentiator: offers a shared, tested way to compute and display differences from prettier output, avoiding duplication across multiple linter integrations. Lightweight with no dependencies, but relies on prettier being installed separately.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-linter-helpers"],"cli":null},"imports":["import { showInvisibles } from 'prettier-linter-helpers'","import { generateDifferences } from 'prettier-linter-helpers'","import * as helpers from 'prettier-linter-helpers'","import type { Difference } from 'prettier-linter-helpers'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { showInvisibles, generateDifferences } from 'prettier-linter-helpers';\n\nconst source = 'const x = 1;\\n';\nconst prettierSource = 'const x = 1;\\n';\n\n// Show invisible characters (tab, space, newline)\nconst visible = showInvisibles(source);\nconsole.log(visible);\n// 'const x = 1;·\\n'\n\n// Generate differences between source and prettierSource\nconst diffs = generateDifferences(source, prettierSource);\nconsole.log(diffs);\n// []\n\n// Example with a difference\nconst source2 = 'const x = 1';\nconst prettierSource2 = 'const x = 1;\\n';\nconst diffs2 = generateDifferences(source2, prettierSource2);\nconsole.log(diffs2);\n// [ { offset: 11, operation: 'insert', insertText: ';\\n' } ]\n","lang":"typescript","description":"Imports the two helper functions, shows use of showInvisibles to make whitespace visible, and generateDifferences to compare two strings.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}