Skip to content

Replace NodeJS "path" with "upath": normalize paths to posix style #4124

Description

@slorber

💥 Proposal

https://www.npmjs.com/package/upath#why

It could be less painful to ensure Windows support if all paths where using posix style (/ separator) instead of being platform dependent.

Windows/NodeJS is able to understand both / and \\ so it would be nice to normalize on all paths on posix style.

This could prevent issues we often see after committing, when the CI (build or tests) fails but only on Windows, such as:

image

My idea would be to:

  • Use "upath" everywhere
  • Use upath.normalize() everywhere instead of our custom posixPath() fn.
  • Prevent "path" from being imported with an ESLint rule

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue is a proposal, usually non-trivial change

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions