This commit is contained in:
commit
b4f68f48c6
14 changed files with 872 additions and 0 deletions
69
src/sort.ts
Normal file
69
src/sort.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import { createSortGroups } from './utilities';
|
||||
|
||||
const namesOrder = [
|
||||
'type',
|
||||
'instance',
|
||||
'id',
|
||||
'name',
|
||||
'meta',
|
||||
'title',
|
||||
'description',
|
||||
'author',
|
||||
'version',
|
||||
'multiplicity',
|
||||
];
|
||||
|
||||
export const sortBaseRule = {
|
||||
alphabet: 'custom',
|
||||
order: 'asc',
|
||||
type: 'natural',
|
||||
...createSortGroups(namesOrder, {
|
||||
bottom: ['property', 'method', 'unknown'],
|
||||
}),
|
||||
};
|
||||
|
||||
export const sortDetailedRule = {
|
||||
alphabet: 'custom',
|
||||
order: 'asc',
|
||||
type: 'natural',
|
||||
...createSortGroups(namesOrder, {
|
||||
bottom: [
|
||||
// static public property
|
||||
['static-property', 'static-accessor-property'],
|
||||
['static-get-method', 'static-set-method'],
|
||||
// static protected property
|
||||
['protected-static-property', 'protected-static-accessor-property'],
|
||||
['protected-static-get-method', 'protected-static-set-method'],
|
||||
// private protected property
|
||||
['private-static-property', 'private-static-accessor-property'],
|
||||
['private-static-get-method', 'private-static-set-method'],
|
||||
// static block
|
||||
'static-block',
|
||||
// normal properties
|
||||
'property',
|
||||
'protected-property',
|
||||
'private-property',
|
||||
// constructor
|
||||
'constructor',
|
||||
// public callable
|
||||
'accessor-property',
|
||||
['get-method', 'set-method'],
|
||||
// protected callable
|
||||
'protected-accessor-property',
|
||||
['protected-get-method', 'protected-set-method'],
|
||||
// private callable
|
||||
'private-accessor-property',
|
||||
['private-get-method', 'private-set-method'],
|
||||
// static methods
|
||||
['static-method', 'static-function-property'],
|
||||
['protected-static-method', 'protected-static-function-property'],
|
||||
['private-static-method', 'private-static-function-property'],
|
||||
// methods
|
||||
['method', 'function-property'],
|
||||
['protected-method', 'protected-function-property'],
|
||||
['private-method', 'private-function-property'],
|
||||
// unknown
|
||||
'unknown',
|
||||
],
|
||||
}),
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue