sort-class

1.0.1 • Public • Published

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

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
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 Hat

This 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 http://www.gnu.org/licenses/.

Readme

Keywords

Package Sidebar

Install

npm i sort-class

Weekly Downloads

4

Version

1.0.1

License

GPL-3.0+

Unpacked Size

41 kB

Total Files

5

Last publish

Collaborators

  • misterhat