Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Typegoose SortNew to Visual Studio Code? Get it now.
Typegoose Sort

Typegoose Sort

JW-extensions

|
7 installs
| (0) | Free
A tool for sorting typegoose models
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Typegoose Sort README

Overview

Typegoose Sort is a tool for sorting typegoose models by property name

How to use

Highlight the properties you would like to sort

Type 'Typegoose Sort' into the command palette (Cmd + Shift + P)

Caveats

Supports VS Code version >=1.95.0

Models must be double new-line separated

Models will be sorted using .localeCompare() (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)

Example

Unsorted code:

@prop({ ref: "UserSchema" })
public propA?: Ref<UserSchema>;

@prop({ type: () => String })
public propD?: string;

@prop({ type: () => Number })
public propX?: number;

@prop({ type: () => mongoose.Types.ObjectId })
public propC?: mongoose.Types.ObjectId;

@prop({ type: () => [String] })
public prop1?: string[];

Sorted code:

@prop({ type: () => [String] })
public prop1?: string[];

@prop({ ref: "UserSchema" })
public propA?: Ref<UserSchema>;

@prop({ type: () => mongoose.Types.ObjectId })
public propC?: mongoose.Types.ObjectId;

@prop({ type: () => String })
public propD?: string;

@prop({ type: () => Number })
public propX?: number;
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft