Skip to content

Commit 50fe75f

Browse files
committed
fix: detect case-sensitive filesystems correctly under yarn PnP
yarn under PnP does not create a `node_modules` directory, and instead files like `reSOLVE.js` file is served from a virtual filesystem, which is always case sensitive and not representative of the real underlying filesystem.
1 parent e156316 commit 50fe75f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/resolve.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const path = require('path');
1010
const hashObject = require('./hash').hashObject;
1111
const ModuleCache = require('./ModuleCache').default;
1212

13-
const CASE_SENSITIVE_FS = !fs.existsSync(path.join(__dirname.toUpperCase(), 'reSOLVE.js'));
13+
const projectDir = pkgDir.sync(path.dirname(__dirname));
14+
const CASE_SENSITIVE_FS = !fs.existsSync(projectDir ? path.join(projectDir.toUpperCase(), 'pacKAGE.json') : path.join(__dirname.toUpperCase(), 'reSOLVE.js'));
1415
exports.CASE_SENSITIVE_FS = CASE_SENSITIVE_FS;
1516

1617
const ERROR_NAME = 'EslintPluginImportResolveError';

0 commit comments

Comments
 (0)