microsoft / microsoft/monaco-editor

[Feature Request] Expose TypeScript formatting options

Open
#4,067 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted typescript
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

Currently, the formatting options for TypeScript/JavaScript are hardcoded unlike those for HTML and CSS.
Exposing these options has already been requested in #88, although I'm opening a new issue as the old one is locked.

I don't necessarily expect the feature to be implemented by anyone but myself, so I'm fine looking into doing it.
I do want to know beforehand whether it even makes sense to spend time doing it, though.

And how should the new API look? I see two main possibilities:

  1. All the existing options as well as the formatting options are put into an Options interface, similar to how HTML and CSS do it.
    The old properties would then be depracated and changed to simply access the new options.
  2. A new interface is added called something like TSFormattingOptions and the existing ones are left as is.

I personally think option 1 is nicer and brings the API more in line with HTML and CSS, but does require deprecations in the API.

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the existing HTML and CSS formatting option APIs with the hardcoded TypeScript/JavaScript formatting options described in the issue. Decide whether to introduce a shared Options interface or a separate TSFormattingOptions interface, then verify that the chosen API exposes the formatting settings while preserving or clearly deprecating existing properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.