Skip to content

Convert tidier.js to TypeScript #3815

Closed

Description

@raclim

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.js to tidier.ts.
  • Add in TypeScript types for the CodeMirror view and the mode argument, 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

  1. added
    EnhancementImprovement to an existing feature
    Area: Code QualityFor refactoring, cleanup, or improvements to maintainability
    Area: Typescript MigrationRelated to Typescript Migration after the initial pr05 grant 2025 migration work
    on Jan 28, 2026
  2. added
    On HoldWork on this issue is paused for now
    and removed on Jan 28, 2026
  3. VaibhavNarayann commented on Jan 28, 2026

    @VaibhavNarayann
    Contributor

    I’m interested in working on this. Could you assign it to me, please?

  4. VaibhavNarayann commented on Jan 29, 2026

    @VaibhavNarayann
    Contributor

    Hi! I’ve opened a PR that addresses this issue: #3815
    Happy to make any changes based on feedback.

  5. removed
    On HoldWork on this issue is paused for now
    on Feb 20, 2026
  6. raclim commented on Mar 6, 2026

    @raclim
    CollaboratorAuthor

    Resolved by #3899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Code QualityFor refactoring, cleanup, or improvements to maintainabilityArea: Typescript MigrationRelated to Typescript Migration after the initial pr05 grant 2025 migration workEnhancementImprovement to an existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions