Skip to content

Task sorting is unreliable when using the verbose option #1789

@PetrisorTanasa

Description

@PetrisorTanasa

Hi

Inside grunt.js there are the following lines

  // Display available tasks (for shell completion, etc).
  _tasks = Object.keys(grunt.task._tasks).sort();

While this would be correct in the case of the english alphabet, for special characters from all over the world it might produce unexpected an unexpected behaviour. The fix is using localeCompare.

  // Display available tasks (for shell completion, etc).
  _tasks = Object.keys(grunt.task._tasks).sort((a, b) => a.localeCompare(b));

If needed, I could open a PR on this.

Thanks!

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