sindresorhus/eslint-plugin-unicorn

Rule proposal: `prefer-process-cwd`

Open

#2,651 建立於 2025年5月9日

在 GitHub 查看
 (4 留言) (4 反應) (0 負責人)JavaScript (5,022 star) (468 fork)user submission
help wantednew rule

描述

Description

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

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

Examples

// ❌
path.resolve()

// ✅
process.cwd()

Proposed rule name

prefer-process-cwd

Additional Info

I didn't use this pattern, but I found quite a lot of usage on GitHub.

TypeScript

JavaScript

貢獻者指南

Rule proposal: `prefer-process-cwd` · sindresorhus/eslint-plugin-unicorn#2651 | Good First Issue