https://github.com/avraammavridis/vsc-sort-react
VS Code extension to sort React Proptypes
https://github.com/avraammavridis/vsc-sort-react
javascript react react-native vscode vscode-extension
Last synced: 7 months ago
JSON representation
VS Code extension to sort React Proptypes
- Host: GitHub
- URL: https://github.com/avraammavridis/vsc-sort-react
- Owner: AvraamMavridis
- Created: 2018-07-31T11:59:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T00:06:24.000Z (over 5 years ago)
- Last Synced: 2025-02-28T14:03:40.110Z (7 months ago)
- Topics: javascript, react, react-native, vscode, vscode-extension
- Language: JavaScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=avraammavridis.vsc-sort-react
- Size: 1.43 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vsc-sort-react README
[](https://greenkeeper.io/)
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
```javascript
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
```javascript
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
isBackgroundImage: PropTypes.bool,
isCircled: PropTypes.bool,
src: PropTypes.string.isRequired,
tinySrc: PropTypes.string
};
```
## Sort by name lengthThis
```javascript
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
```javascript
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
```javascript
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
```javascript
static propTypes = {
children: PropTypes.node,
isCircled: PropTypes.bool,
tinySrc: PropTypes.string,
className: PropTypes.string,
src: PropTypes.string.isRequired,
isBackgroundImage: PropTypes.bool
};
```