Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>TS-Arrange2New to Visual Studio Code? Get it now.
TS-Arrange2

TS-Arrange2

DrMueller2

|
1,406 installs
| (1) | Free
TypeScript Extension to arrange elements within a Class
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TS-Arrange2

A plugin for Typescript, which arranges elements within a class.

Installation

On the extensions tab, search for TS-Arrange2 and install it.

Features

Genal

This plugin arranges elements within a class by the following attributes attributes:

  • Visibility
  • Location (Static / Instance)
  • Kind (Property, Field, Constructor)

Sorting algorithm

  • The sorting of the blocks is determinated by the TSLint rule member-ordering
  • Within each element block, the members are ordered by their name
  • Elements, which can't be associated, are set at the end of the class

Limitations

The logic expects a member-ordering configuration with the exact declaration, for example:

"member-ordering": [
      true,
      {
        "order": [
          "public-static-field",
          "public-instance-field",
          "protected-static-field",
          "protected-instance-field",
          "private-static-field",
          "private-instance-field",
          "public-constructor",
          "protected-constructor",
          "private-constructor",
          "public-static-method",
          "public-instance-method",
          "protected-static-method",
          "protected-instance-method",
          "private-static-method",
          "private-instance-method"
        ]
      }
    ],

Usage

Shortcut

  1. Navigate to the desired Typescript Class
  2. Use ctrl+shift+a to invoke the command

Command Palette

  1. Navigate to the desired Typescript Class
  2. In the command palette(ctrl+shift+p), enter Arrange File

Contributing

If you have any questions, fixes or enhancements, please create a pull request or an issue. Github

History

Please see the changelog.

License

This software is released under MIT License

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft