Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/misterhat/sort-class
sort class methods in js source
https://github.com/misterhat/sort-class
javascript-tools sort vim
Last synced: 24 days ago
JSON representation
sort class methods in js source
- Host: GitHub
- URL: https://github.com/misterhat/sort-class
- Owner: misterhat
- License: gpl-3.0
- Created: 2018-02-08T19:52:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-02-08T20:11:28.000Z (over 6 years ago)
- Last Synced: 2024-10-01T15:54:14.637Z (about 1 month ago)
- Topics: javascript-tools, sort, vim
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# sort-class
it's really annoying to sort methods alphabetically in vim, so i made this tool.
it might not work with your coding style, but it doesn't mangle the original
file.## installation
# npm install -g sort-class
## example
*test.js*```javascript
class Test {
methodB() {
console.log('this is method b');
}constructor() {
this.timestamp = Date.now();
}methodA() {
console.log('this is method a');
}
}
```$ ./sort-class test.js
```javascript
class Test {
constructor() {
this.timestamp = Date.now();
}methodA() {
console.log('this is method a');
}methodB() {
console.log('this is method b');
}
}
```## bugs
don't put bracket characters (`{`, `}`) within block comments.## license
Copyright (C) 2018 Mister HatThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see .