Repository navigation
Convert tidier.js to TypeScript #3815
Description
Note: Preserved for CodeDay contributors.
This issue is part of the ongoing work to upgrade CodeMirror from v5 to v6 (see the parent issue for additional context). Alongside this upgrade, the project is also continuing a broader ongoing TypeScript Migration from JavaScript.
Increasing Access
As we're preparing to release the new CodeMirror v6 feature, we'd like to maintain consistency and long-term maintainability to convert files into TypeScript. Breaking down conversion process to happen incrementally through smaller, scoped modules and components can help contributors participate in the migration without needing to immediately understand the entire codebase at once.
Feature Details
The files within the upcoming CM v6 upgrade will need to be converted from JavaScript to TypeScript files.
This issue specifically focuses on tidier.js file. This file runs Prettier on the active CodeMirror editor instance by formatting the current file content using prettier.formatWithCursor and then updating the editor document while keeping the cursor's position.
Suggestions to Start
- Rename
tidier.jstotidier.ts. - Add in TypeScript types for the CodeMirror view and the
modeargument, as well as any other values that will be flagged during the conversion. - Update any needed imports/exports.
- Manually check that "Tidy" and "Format" works for JavaScript, HTML, and CSS files. When formatting the editor content, the cursor should remain stable and not jump to a different location unexpectedly.
Activity
VaibhavNarayann commentedon Jan 28, 2026
I’m interested in working on this. Could you assign it to me, please?
VaibhavNarayann commentedon Jan 29, 2026
Hi! I’ve opened a PR that addresses this issue: #3815
Happy to make any changes based on feedback.
raclim commentedon Mar 6, 2026
Resolved by #3899