fix(docs): order class members in order of declaration

Previously, class members were ordered alphabetically.
This change leaves it up to the class author to
determine the order in which they would like
properties and methods to appear in class
documentation, without having to create methods like
`zUnimportantMethod`.

Fixes #2569
This commit is contained in:
Jeff Cross 2015-06-16 13:30:36 -07:00
parent 35589a6b3c
commit ea27704ea9
2 changed files with 5 additions and 5 deletions

View File

@ -24,8 +24,8 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo
basePath: '.',
// We can ignore members of classes that are private
hidePrivateMembers: true,
// We can sort class members alphabetically
sortClassMembers: true,
// We leave class members sorted in order of declaration
sortClassMembers: false,
// We can provide a collection of strings or regexes to ignore exports whose export names match
ignoreExportsMatching: ['___esModule'],

View File

@ -46,16 +46,16 @@ describe('readTypeScriptModules', function() {
describe('ordering of members', function() {
it('should order class members alphabetically (by default)', function() {
it('should order class members in order of appearance (by default)', function() {
processor.sourceFiles = ['orderingOfMembers.ts'];
var docs = [];
processor.$process(docs);
var classDoc = _.find(docs, { docType: 'class' });
expect(classDoc.docType).toEqual('class');
expect(getNames(classDoc.members)).toEqual([
'doStuff',
'firstItem',
'otherMethod'
'otherMethod',
'doStuff',
]);
});