Files
bookmarkmagic/tsconfig.scripts.json
poli0981andClaude Opus 5.5 0671bb3c33 fix(scripts): the sanitizer stops leaking Chrome profile titles, and every script is checked
sanitize-bookmarks.mjs accepted any JSON object and rewrote only "url" and
"title". Chrome's profile Bookmarks file keeps titles under "name" (plus
meta_info and a base64 sync_metadata blob), so it came out with every title
intact, passed the host-only leak check, and was written as "sanitized" —
the exact file a reporter whose import failed would attach.

- JSON dialects are recognised by shape (BookmarkMagic, Chrome profile,
  Firefox backup); any other JSON is refused. Rewriting is default-deny: a
  small tokenizer tracks the key of every string value and replaces all of
  them except structural keys (types, ids, timestamps, root GUIDs), by span,
  so layout and key order stay byte-identical.
- The backstop now reads the output's TEXT: for HTML it strips markup and
  refuses on any word that is not a placeholder — independent of the
  rewriting rules, unlike the old host-only check whose test shared its
  blind spots. <DD class=…> notes, file: ICON_URIs and <H1>/<TITLE>
  owner names are rewritten.
- Attribute values decode in one pass (CodeQL js/double-escaping), <DD>
  bodies are found in linear time (Sonar S8786), the input is never
  overwritten, size is checked before reading, and bytes are bytes.
- The 627-line file is split into scripts/sanitize/ modules; the
  user-facing entry stays plain .mjs for reporters on any Node.

gen-fixture.mjs validates its flags (whole numbers >= 1, values required, no
unknown flags) and its loop visibly advances (Sonar S2189 blocker).
gen-icons.mjs says what is true: it is the icons' source of truth.

Every script now carries // @ts-check and tsconfig.scripts.json runs them
through the TS 7 tsc in `npm run check`; docs/10's size rule names .mjs.
Regenerated icons are byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:06:52 +07:00

17 lines
343 B
JSON

{
"compilerOptions": {
"target": "ES2025",
"lib": ["ES2025"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"allowJs": true,
"checkJs": true,
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"noUncheckedIndexedAccess": true
},
"include": ["scripts/**/*.mjs"]
}