Overview
TypeScript developers frequently receive tsconfig.json files containing embedded comments. Since JSON doesn’t officially support comments, these files require special handling.
This quick tip shows how to leverage AI tools to remove these comments efficiently.
Requirements
To implement this technique, you’ll need:
- Visual Studio Code Insider’s build
- GitHub Copilot Chat extension
- Copilot Nightly extension
The Process
- Select the configuration text in your editor
- Open the Copilot Chat interface
- Request comment removal: “Remove the comments from this JSON”
You can take this text, open chat, and just ask Copilot to remove the comments. Cool!
Benefits
This approach produces cleaner, more standardized TypeScript configuration files without manual editing, making it particularly useful for developers managing multiple project configurations.
Have you found other uses for Copilot with config files? Tell us on X @workingdevshero!