Eslint plugin (eslint v9) can't find Typescript config file (eslint.config.ts)

I have a small project where I use Eslint v9 (9.14 as of writing) and an `eslint.config.ts` config file. As per the Eslint instrictions, I have also installed `jiti` (Configuration Files - ESLint - Pluggable JavaScript Linter). And in my IDE Eslint config I have added the “Extra eslint options” `--flag unstable_ts_config` (ESLint | WebStorm Documentation).

However the IDE Eslint plugin still refuses to work, saying it can't find the config file:

If in the IDE settings I also manually specify the Eslint binary and the config file, I get a new error implying that the imports within the config file aren't working correctly (but `jiti` is being used now, good?):

All this is odd because I have no problems with:

1. Running `npx eslint --flag unstable_ts_config .` in the CLI for this project.

2. Using VSCode and the main Eslint extension for it, with the same `--flag` added as extra arguments.

So it is just a Webstorm Eslint plugin issue as far as I can tell.

I am on latest Webstorm v2024.3. I use Windows 11 with WSL v2 (NixOS).

0
8 comments

Unfortunately I failed to reproduce the issue in Webstorm v2024.3 using similar setup.

What package manager do you use? Would it be possible to narrow the problem down to a minimal repo project and share this with us?

0

Share how? I have one.

0

You can share the project via https://uploads.jetbrains.com/ form and let me know the upload ID.

Thank you.

0

Here it is.

Upload id: 2025_03_12_2BZdzr7M9puq8cii1N2Fma (file: idea-eslint-repro.zip)

Error: Invalid option '--flag' - perhaps you meant '--fix'?
Error: Invalid option '--flag' - perhaps you meant '--fix'?
   at getOption (/Users/dolan/IdeaProjects/papertrace/code/node_modules/optionator/lib/index.js:169:15)
   at Object.parse (/Users/dolan/IdeaProjects/papertrace/code/node_modules/optionator/lib/index.js:398:23)
   at ESLint8Plugin.<anonymous> (/Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:155:59)
   at step (/Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:44:23)
   at Object.next (/Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:25:53)
   at /Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:19:71
   at new Promise (<anonymous>)
   at __awaiter (/Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:15:12)
   at ESLint8Plugin.invokeESLint (/Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:145:16)
   at ESLint8Plugin.<anonymous> (/Applications/IntelliJ IDEA.app/Contents/plugins/javascript-impl/languageService/eslint/bin/eslint8-plugin.js:132:44)
Process finished with exit code -1
0

Unfortunately I failed to reproduce the issue in the project you have shared:

Which version of the IDE are you using? 

0

OP here, sorry I left this after your initial response Elena Pogorelova. I figured out later that this issue only ocurred on Windows 11 when Webstorm had opened a repo that was within a WSL2 filesystem. Opening a repo on the windows filesystem did not have any issue. Booting a complete linux OS (tested Debian) did not have the issue either.

0

Thanks Elena, I was on an older version that pre-dated flatConfig as you suspected. Upgraded and it's working correctly now.

0
Great, thanks for the update!
0

Please sign in to leave a comment.