Open ctaylor4874 opened 5 years ago
Do you know which version of eslint your IDE integration is expecting?
Same problem here with webstorm 2019.2.3 It works fine with eslint@5.16
congratulations for eslint_d. amazing package
Thank you! While I'd like to support other editors, my personal need is focused on vim. Therefore I rely on the community to fix issues in other editors. I would totally merge any PRs or improve documentation if anyone has an idea why this is happening for Webstorm users. ❤️
I have the same issue 😞
StackTrace:
Initialization error (ESLint). Cannot find module 'C:/Users/x/Documents/y/frontend/node_modules/eslint_d/lib/api'
Error: Cannot find module 'C:/Users/x/Documents/y/frontend/node_modules/eslint_d/lib/api'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at requireInContext (C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js:183:12)
at new ESLintPlugin (C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js:46:30)
at ESLintPluginFactory.create (C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin-provider.js:9:34)
at Interface.<anonymous> (C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\plugins\JavaScriptLanguage\jsLanguageServicesImpl\js-language-service.js:82:52)
at Interface.emit (events.js:198:13)
at Interface._onLine (readline.js:308:10)
Process finished with exit code -1
The configuration:
My IntelliJ IDEA version:
IntelliJ IDEA 2020.3.1 (Ultimate Edition)
Build #IU-203.6682.168, built on December 29, 2020
Runtime version: 11.0.9.1+11-b1145.63 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 4012M
Cores: 12
Registry: ide.usages.page.size=500, ide.balloon.shadow.size=0, eslint.service.node.arguments=--max_old_space_size=8192
Non-Bundled Plugins: com.chrisrm.idea.MaterialThemeUI, com.intellij.ideolog, com.jetbrains.ChooseRuntime, com.mallowigi, com.almightyalpaca.intellij.plugins.discord, AWSCloudFormation, patrick.kelleter.angular-cli-quick-switch, String Manipulation, intellij.prettierJS, com.microsoft.tooling.msservices.intellij.azure, izhangzhihao.rainbow.brackets
Dependencies:
"eslint": "^7.13.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-recommended": "^4.1.0",
"eslint-import-resolver-typescript": "^2.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsdoc": "^30.7.8",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-progress": "0.0.1",
"eslint_d": "^9.1.2",
Node 10.16.0
I played around with this a little bit as this error is still out there. So I compared the eslint@8 and eslint_d package. eslint has a lib/api.js which exports a member: ESLint. This is a constructor for an ESLint class. Webstorm internally instantiates this class.
@mantoni does eslint_d provide a class? If not, do you see a way to implement this?
Same problem here with latest PHPStorm and WEBStorm. It would very useful have a working eslint_d integration, because the default eslint integration has lot of problems with large files/codebases.
Hm, that's a tricky one since eslint_d
is designed to be replacement for the command line interface.
If WebStorm tries to create an instance of the ESLint class we'd have to implement a compatible class for eslint_d
that delegates internally to the instance in the daemon process.
I'm also wondering if that would actually make anything faster. Are they creating the class instance for every linter invocation? Then yes. If they're caching the instance and reuse it, then this is exactly what eslint_d
does as well.
Isn't there a way in WebStorm to delegate linting to a command line tool?
@pasor1 I think the integration is now broken as I could not make any progress.
Another idea for working with large codebases is activating the --cache
flag on eslint itself.
I also did not manage to configure eslit_d
in latest Webstorm:
Initialization error (ESLint). Cannot find module '/<projectpath>/node_modules/eslint_d/'
Another idea for working with large codebases is activating the --cache flag on eslint itself.
This is quite unfortunate as it seems the --cache
flag currently does not work due to a bug.
So, as for today, there really seems no ways to improve eslint performance in Webstorm 😭
I'm getting the error
when I try the Webstorm integration.
Steps to reproduce:
Preferences
.Languages & Frameworks
>JavaScript
>Code Quality Tools
>ESLint
Manual ESLint Configuration
ESLint package
set it to your local eslint_d