Skip to content

Allow back predefined "files" order when using the files option #33

@dmnsgn

Description

@dmnsgn

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:

/* 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 filesSort option
  • sort file-set per array items instead of the final this.inputFileSet.files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions