sindresorhus/eslint-plugin-unicorn

Rule proposal: `prefer-process-cwd`

Open

Aperta il 9 mag 2025

Vedi su GitHub
 (4 commenti) (4 reazioni) (0 assegnatari)JavaScript (5022 star) (468 fork)user submission
help wantednew rule

Descrizione

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

Guida contributor