Skip to content

New Rule: prefer-process-cwd #443

Open
@fisker

Description

@fisker

Rule details

Prefer process.cwd() over path.resolve().

The results are the same, but process.cwd() is faster and has a clear intention.

What type of rule is this?

Suggests an alternate way of doing something

Example code

// ❌
path.resolve()

// ✅
process.cwd()

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

This proposal was originally suggested in eslint-plugin-unicorn, but feels more suitable in this repo.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions