microsoft / microsoft/vscode-documentdb
Consolidate ANSI output sanitization after the ESM migration
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31
- Forks
- 22
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 21
Description
Context
Commit 26f051e8 fixes raw ANSI/VT control characters in Local Quick Start Docker logs without adding a dependency:
- Local Quick Start requests colorless output with
NO_COLOR=1andTERM=dumb. - Output is defensively sanitized with Node's
stripVTControlCharactersbefore it reaches the plain-text VS Code OutputChannel. - The playground result formatter still has a separate, SGR-only regular expression.
We deliberately avoided adding strip-ansi while the extension is CommonJS. Its current release line is ESM-only, and the CommonJS-compatible 6.x line would be a new dependency on an older release.
Follow-up
After #687 migrates the extension from CommonJS to ESM:
- Review all non-terminal output surfaces that may receive ANSI/VT sequences.
- Consolidate the Local Quick Start and playground sanitizers behind one shared utility.
- Decide whether Node's built-in sanitizer remains sufficient or an ESM-native dependency provides useful behavior.
- Keep terminal/PTY surfaces unchanged, since they should continue interpreting ANSI formatting.
- Add shared regression coverage for SGR sequences and other supported VT controls.
Related: #687
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
After #687, review commit 26f051e8 and inspect the Local Quick Start and playground output paths for their existing sanitizers. Compare Node's stripVTControlCharacters with the playground's SGR-only expression, then add shared regression coverage for SGR and other supported VT controls while leaving terminal/PTY surfaces unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- devtools
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100