-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Description
While fixing a new glob behaviour, the introduction of input files sorting modifies the behaviour if you pass files defined in a specific order.
Commit: 7083d03#diff-d7ec8b2f1fcf6a2e2af8a75e28d6800d4dfe8ac6b6d35a6faf3034e36ba51d08
Problematic code:
jsdoc-api/lib/jsdoc-command.js
Lines 45 to 47 in 4d06895
| /* node-glob v9+ (used by file-set) no longer sorts the output by default. We will continue to sort the file list, for now, as it's what the user expected by default. The user's system locale is used. */ | |
| const collator = new Intl.Collator() | |
| this.inputFileSet.files.sort(collator.compare) |
I hope I tracked this issue correctly and it is not something unrelated to the above 🙏
Use case
I am sorting files before doing a jsdoc2md.render() in jsdoc-to-markdown so I can get docs generated in an order that makes more sense than alphabetical.
Issues
- breaks generated docs order in jsdoc-to-markdown since v9.3.0
- it is not possible to define a custom order for generated docs (afaik)
- isn't using
new Intl.Collator()making it potentially platform dependent, if it is related to the computer locale?
Solutions
- add a
filesSortoption - sort
file-setper array items instead of the finalthis.inputFileSet.files?
Metadata
Metadata
Assignees
Labels
No labels