ESLint-Formatter
ESLint-Formatter copied to clipboard
Cannot find module
When I try to run it, I get an error popup saying that the module 'C:\Users\Me' cannot be found. I have eslint installed and I can run it just fine on the command line.
You should check the plugin config and see if all the paths in there are correct. You should enable debug: true in the config and check the console for error messages.
Sorry for the very late reaction.
I tried to see whether I could figure out the issue again and this time(how did I not notice this last time) I noticed that my username folder was cut in half.
The thrown error says that module 'C:\Users\A' cannot be found but my name is 'A B' so perhaps the space is causing the issue?
The thrown error says that module 'C:\Users\A' cannot be found but my name is 'A B' so perhaps the space is causing the issue?
This seems likely. It'd be worth checking if running subprocess.Popen('C:\Users\A B\...\path\to\eslint') works as expected.
I was getting module_not_found issues, in my case I think it's because I'm mounting a remote filesystem via SFTP using GVFS on Linux. I think there's some issue with following symlinks, but never confirmed that.
I fixed it by copying the eslint file into my home directory and ensuring I only ever use local eslint stuff in Sublime:
{
"local_eslint_path": {
"linux": ""
},
"eslint_path": {
"linux": "/home/username/node_modules/.bin/eslint",
"config_path": "/home/username/.eslintrc.custom.json"
},
"extra_args": ["--no-eslintrc"]
}
That got rid of the error, but I noticed it's not actually fixing any kind of formatting now... but hopefully this helps someone get further.
Silly me, this is at least partly because config_path is not part of eslint_path, it's a top-level option. This allows it to format:
{
"local_eslint_path": {
"linux": ""
},
"eslint_path": {
"linux": "/home/username/node_modules/.bin/eslint"
},
"config_path": "/home/username/.eslintrc.custom.json",
"extra_args": ["--no-eslintrc"]
}
It's not formatting everything I would expect, but I haven't touched that eslint file in a while, and it did change at least one thing. So I think it's working this way.