sindresorhus/eslint-plugin-unicorn

Rule proposal: `prefer-process-cwd`

Open

#2.651 geöffnet am 9. Mai 2025

Auf GitHub ansehen
 (4 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)JavaScript (5.022 Stars) (468 Forks)user submission
help wantednew rule

Beschreibung

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

Contributor Guide