Skip to content

Convert tidier.js to TypeScript and add CodeMirror view typings#3823

Closed
VaibhavNarayann wants to merge 0 commit intoprocessing:develop-codemirror-v6from
VaibhavNarayann:develop-codemirror-v6
Closed

Convert tidier.js to TypeScript and add CodeMirror view typings#3823
VaibhavNarayann wants to merge 0 commit intoprocessing:develop-codemirror-v6from
VaibhavNarayann:develop-codemirror-v6

Conversation

@VaibhavNarayann
Copy link

@VaibhavNarayann VaibhavNarayann commented Jan 29, 2026

Fixes #3815

Summary

This PR converts the existing tidier.js module to TypeScript and adds explicit
typings while preserving the current formatting behavior.

Changes

  • Renamed tidier.jstidier.ts
  • Added TypeScript typings for:
    • CodeMirror EditorView
    • Formatter mode (javascript | html | css)
  • Updated imports and exports to be TypeScript-compatible
  • Added local module declarations for Prettier standalone and parser packages
  • Preserved existing formatting logic using formatWithCursor

Verification

Manually verified that Tidy / Format works correctly for:

  • JavaScript
  • HTML
  • CSS

The editor cursor remains stable after formatting and does not jump unexpectedly.

Checklist

I have verified that this pull request:

  • No linting errors (npm run lint)
  • No test failures (npm run test)
  • No TypeScript errors (npm run typecheck)
  • Changes are on a dedicated feature branch
  • PR references the related issue (Fixes #3815)
  • Changes comply with the project’s accessibility guidelines

@release-com
Copy link

release-com bot commented Feb 3, 2026

Release Environments

This Environment is provided by Release, learn more!
To see the status of the Environment click on Environment Status below.

🔧Environment Status : https://app.release.com/public/Processing%20Foundation/env-21672378de

@khanniie
Copy link
Member

I'm not exactly sure how, but the diff looks a little bit crazy right now : O I glanced at the PR a week ago and the few changes seemed fine, but now I see a much larger diff, I assume because of some rebasing or pulling from develop? I've had this happen before and couldn't figure out how to fix it other than opening a new branch and cherrypicking my changes over... is there any way to do something similar here?

@Nixxx19
Copy link
Contributor

Nixxx19 commented Feb 20, 2026

hey @khanniie, it definitely looks like some extra history got pulled in during a merge or rebase. the best way to solve this and much faster than cherry-picking to a new branch is a soft reset.

@VaibhavNarayann, if you run git reset --soft origin/develop-codemirror-v6, it will keep all your code changes but clear the messy history. then you can just make one fresh commit, and the diff will be perfectly clean. you'll just need to git push --force after that to update the PR.

@VaibhavNarayann VaibhavNarayann deleted the develop-codemirror-v6 branch February 20, 2026 17:32
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.

3 participants