sindresorhus/eslint-plugin-unicorn

Rule proposal: `prefer-process-cwd`

已关闭

#2,651 创建于 2025年5月9日

 (4 条评论) (4 个反应) (0 位负责人)JavaScript (468 个派生)user submission
help wantednew rule

仓库指标

星标
 (5,022 个星标)
PR 合并指标
 (平均合并 1天 16小时) (30 天内合并 399 个 PR)

描述

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

贡献者指南