Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Sort React PropTypesNew to Visual Studio Code? Get it now.
Sort React PropTypes

Sort React PropTypes

avraammavridis

|
2,725 installs
| (0) | Free
Sort React PropTypes properties by name, name length or line length
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vsc-sort-react README

Press ⇧⌘P and start typing Sort

You should have 3 options.

  • Sort alphabetically
  • Sort properties by the length of their name
  • Sort properties by the length of the line

Sort Alphabetically Example

This

  static propTypes = {
    children: PropTypes.node,
    className: PropTypes.string,
    isCircled: PropTypes.bool,
    src: PropTypes.string.isRequired,
    isBackgroundImage: PropTypes.bool
    tinySrc: PropTypes.string,
  };

Will be converted to

  static propTypes = {
    children: PropTypes.node,
    className: PropTypes.string,
    isBackgroundImage: PropTypes.bool,
    isCircled: PropTypes.bool,
    src: PropTypes.string.isRequired,
    tinySrc: PropTypes.string
  };

Sort by name length

This

  static propTypes = {
    children: PropTypes.node,
    className: PropTypes.string,
    isCircled: PropTypes.bool,
    src: PropTypes.string.isRequired,
    isBackgroundImage: PropTypes.bool
    tinySrc: PropTypes.string,
  };

Will be converted to

  static propTypes = {
    src: PropTypes.string.isRequired,
    tinySrc: PropTypes.string,
    children: PropTypes.node,
    isCircled: PropTypes.bool,
    className: PropTypes.string,
    isBackgroundImage: PropTypes.bool
  };

Sort by line length

This

  static propTypes = {
    children: PropTypes.node,
    className: PropTypes.string,
    isCircled: PropTypes.bool,
    src: PropTypes.string.isRequired,
    isBackgroundImage: PropTypes.bool
    tinySrc: PropTypes.string,
  };

Will be converted to

  static propTypes = {
    children: PropTypes.node,
    isCircled: PropTypes.bool,
    tinySrc: PropTypes.string,
    className: PropTypes.string,
    src: PropTypes.string.isRequired,
    isBackgroundImage: PropTypes.bool
  };
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft