-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems in IntelliJ when node_modules folder is not on top level #8
Comments
I'm assuming that you're running ESLint locally. Is that right? |
As I said, there is nothing there as my node_modules are not installed at root level. The problem is the path to the node_module that is set as fixed in the code (again, as described above). |
This is a solution but ideally, it should work with no configuration. I think a possible solution is somehow finding the absolute path of the directory of the Maybe something like this: path.join(absolutePathToEslint, '../eslint-plugin-flowtype-errors/dist/collect.js') Thoughts? |
Would be the best solution. |
I did a small hack to fix the path, but there are more errors and I am not sure what to do there. Looks like firstMessage does not have a loc. /Users/olli/Development/floreysoft/floreysoft-status/src/main/js/node_modules/eslint-plugin-flowtype-errors/dist/collect.js:112 TypeError: Cannot read property 'start' of undefined |
What was the quick hack that you did? Did it include hardcoding the correct path? |
I'm having the same issue, though with flycheck in emacs. I was able to get past the original error (Error: Cannot find module) by configuring flycheck to use the root of the git repo as the working directory. Then I started getting the same error as @DJCordhose. Doing some more investigation, |
What version of the module are you using? I made a few updates recently. |
Ah, bumping to the latest ( FWIW I was on |
@wukkuan Thanks for the feedback! @DJCordhose Try updating the package. That should do the trick. |
Not finding collect.js has been fixed in 1.2.3, but I still see the next error:
|
Is your |
Hey, good catch. It is not. When I move it to the root everything works just fine :) Do you think it is possible to not require it at root level? Because my project is a mix of Java and JavaScript and it would be weird to have it above my Java folder. Anyway, errors are displayed inline in IntelliJ, added a screen shot for our entertainment :) |
@DJCordhose I can work on adding that feature today. I'm thinking allowing that to be configured in the |
+1 |
@DJCordhose In eclipse, do you have to save a file for the Flow errors to update in the IDE? For example, if you have this: const example: string = 1 // <-- line 1 and add a new space: // line 1
const example: string = 1 // <-- line 2 Do you have to have to save the file for the flow errors to update and report on the new line? |
I use IntelliJ, not Eclipse, but in IntelliJ you get the errors without saving explicitly. Very nice 👍 |
In Atom with the linter-eslint package the warnings/errors also appear as you type, without having to save. |
I see. So it is as @DJCordhose described it?
|
Yes. |
Here's a short demo showing how this doesn't work with my configuration. I only save the file once in the demo. Notice how removing the @pelotom @DJCordhose so just to confirm, you guys aren't experiencing anything like this? |
@amilajack sorry, actually I am seeing wonky behavior specifically with errors from |
I'm using atom, |
@pelotom @DJCordhose I've fixed the issues. Now it should work on the fly without having to save! I would really appreciate if you could test this out before I publish the package.
|
In IntelliJ it worked even before and it still works with 1.2.6 :) |
Yes! Nothing broke! |
Yes, not in IntelliJ :) |
Also what does the error
mean? Does it meant the library definitions can't be found? On what line numbers should these kinds of errors be reported on? This output from
The last error reports a line but the 'inconsistent use of library definitions' errors don't :( |
I tried out the plugin and it works great as a webpack loader, but I can not make it run in Webstorm / IntelliJ. The problem is that it does not seem to find the plugin as the directory it looks in is not right (should be ...src/main/js/...):
Error: Cannot find module '/Users/olli/Development/floreysoft/floreysoft-status/node_modules/eslint-plugin-flowtype-errors/dist/collect.js'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
node node_modules/eslint-plugin-flowtype-errors/dist/collect.js
Looking at the code:
it becomes clear why there is this error: my node_modules are simply somewhere else.
Any ideas? Add a configuration path pointing to the location of the node_modules?
This might simply be because of my messed up set up, but without the plugin it works well and it can also load other plugins without a problem.
The text was updated successfully, but these errors were encountered: