microsoft / microsoft/TypeScript-Sublime-Plugin
Difficulties with JSX/TSX indentation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 236
- Avg merge
- 21d 13h
- Merged PRs (30d)
- 1
Description
I have some issues getting indentation for JSX tags playing along nicely. Here's an exmaple:
render() {
return (
<div class="wrap">
<div>
</div>
</div>
)
}
Creating a new line anywhere within the JSX block indents to the parent starting line, not the indented one
render() {
return (
<div class="wrap">
|here
<div>
</div>
</div>
)
}
Outside of JSX code the intendation works fine, for example inserting a new line after the opening bracket correctly indents by 2. This also messes with simple code formatting like through vintageous.
I tried playing with the typescript_auto_format setting and set my indent settings for typescript files to
{
"tab_size": 2,
"indent_size": 2,
}
but no good. Am I missing a setting here? (
(I have enable_*_language_service off and use typescript LSP through the sublime lsp project)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is mentioned. First reproduce the JSX/TSX indentation behavior in the Sublime Text TypeScript plugin with the shown two-space settings and the reported language-service configuration; done means new lines inside nested JSX follow the surrounding tag indentation and formatting behaves consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100