Skip to content

Comments

Convert tidier.js to TypeScript && test coverage of tidier.ts#3899

Open
kashish00208 wants to merge 4 commits intoprocessing:develop-codemirror-v6from
kashish00208:develop-codemirror-v6
Open

Convert tidier.js to TypeScript && test coverage of tidier.ts#3899
kashish00208 wants to merge 4 commits intoprocessing:develop-codemirror-v6from
kashish00208:develop-codemirror-v6

Conversation

@kashish00208
Copy link

@kashish00208 kashish00208 commented Feb 16, 2026

Fixes #3815 #3816

Changes:
This PR implements the following changes based on issue #3816 #3815:

  1. Rename and TypeScript conversion:
    1. Renamed tidier.js → tidier.ts.
    2. Added TypeScript types for the CodeMirror view, the mode argument, and other values flagged during conversion.
    3. Updated necessary imports/exports.
  2. Functionality verification:
    1. Manually verified that Tidy and Format works correctly for JavaScript, HTML, and CSS files.
    2. Ensured that when formatting the editor content, the cursor remains stable and does not jump unexpectedly.
  3. Integration tests:
    1. Added tests for tidier.ts
    2. Using “Tidy Code” updates the editor document with Prettier formatting.
    3. Cursor position remains stable and predictable after formatting.
    4. Formatting works for HTML, JavaScript, and CSS files.
    5. Tests focus only on integration behavior, not Prettier internals.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for your work! This looks great so far!

We recently merged in a PR that added tests for tidier.js as a JavaScript file—would you be open to updating this PR with the changes from the develop-codemirror-v6 branch, convert that test to TypeScript, and also add in any additional updates to the test that you think would be beneficial?

@kashish00208
Copy link
Author

Thanks so much for your work! This looks great so far!

We recently merged in a PR that added tests for tidier.js as a JavaScript file—would you be open to updating this PR with the changes from the develop-codemirror-v6 branch, convert that test to TypeScript, and also add in any additional updates to the test that you think would be beneficial?

I've updated the PR! I merged the latest changes from develop-codemirror-v6, deleted the JS test file, and fully migrated the suite to TypeScript. I also added the beneficial tests for empty documents and cursor stability do let me know if any chnages needed .

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants