From b54258f8d53c490b45c3d5c6e0dbd62b7d187eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20R=C3=A8gne?= Date: Fri, 1 Dec 2023 18:25:11 +0100 Subject: [PATCH] fix: Get cwd on call. --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 58b5865..0f3721f 100644 --- a/index.js +++ b/index.js @@ -32,8 +32,8 @@ class StandardEngine { this.cmd = opts.cmd /** @type {import('eslint')} */ this.eslint = opts.eslint - /** @type {string} */ - this.cwd = opts.cwd || process.cwd() + /** @type {string|undefined} */ + this.cwd = opts.cwd this.customEslintConfigResolver = opts.resolveEslintConfig const m = opts.version && opts.version.match(/^(\d+)\./) @@ -102,7 +102,7 @@ class StandardEngine { resolveEslintConfig (opts) { const eslintConfig = resolveEslintConfig( { - cwd: this.cwd, + cwd: this.cwd || process.cwd(), ...opts, cmd: this.cmd },