-
-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
import-x/no-unresolved reports a false casing mismatch on macOS for a relative import with a query string suffix like ?raw.
The same import resolves successfully on Linux CI, and the same local file passes when the query string is removed.
Environment
eslint-plugin-import-x:4.16.1eslint:9.39.2- Node.js:
v24.13.0 - OS:
macOS 26.3.1
Repro
package.json
{
"name": "import-x-raw-repro",
"private": true,
"type": "module",
"devDependencies": {
"eslint": "9.39.2",
"eslint-plugin-import-x": "4.16.1"
}
}eslint.config.js
import importX from 'eslint-plugin-import-x';
export default [
{
files: ['**/*.js'],
plugins: {
'import-x': importX,
},
rules: {
'import-x/no-unresolved': 'error',
},
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
},
},
];index.js
import example from './example.ts?raw';
console.log(example);index-no-query.js
import example from './example.ts';
console.log(example);example.ts
export const value = 1;Run:
npm install
npx eslint index.js
npx eslint index-no-query.jsActual
index.js fails with:
1:21 error Casing of ./example.ts?raw does not match the underlying filesystem import-x/no-unresolvedindex-no-query.js passes.
Expected
Both files should pass.
If the resolver accepts ./example.ts?raw, no-unresolved should not report a casing mismatch for the same import.
Notes
This looks like the macOS-only case check may be using a resolved path that still includes the query string when it compares the basename against directory entries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels