Closed IPWright83 closed 2 years ago
This wasn't actually down to CWD - though it looked like it. It was down to some TypeScript path aliasing that was causing the problem.
From https://github.com/SublimeLinter/SublimeLinter-eslint/issues/317#issuecomment-1159571585
Typically, the cwd is where package.json is. The default is here SublimeLinter/SublimeLinter@8ebb2f0/lint/linter.py#L1039
Your configuration of SublimeLinter is not the typical case here as you're setting executable
manually. In that case the place of package.json
will not be resolved and cwd
is set to the first open folder the file is part of.
I think we should log that so users do understand that when you touch executable
you opt-out of the other automatic stuff as well.
You maybe set this because you want eslint_d
. The latest version of this plugin detects eslint_d
installations and prefers them automatically. So maybe setting executable
is not necessary anymore.
Do you know why you have all log lines twice:
SublimeLinter: sublime_linter.py:345 Delay linting 'index.ts' for 0.3s
INFO:SublimeLinter.sublime_linter:Delay linting 'index.ts' for 0.3s
The first line comes from the SublimeLinter logger but who listens for our logger and prints it again?
Ooh, I didn't know you now detect eslint_d
automatically - how can I verify that's working correctly? Just wondering how you locate the file as mines nested in an .nvm
directory. I'd be surprised if that's found automatically?
I don't actually know what's logging that - I have been manually trying to hack around in the linter, but didn't add that line. I'll try re-installing later and see if the logging disappears.
nvm
may be not supported yet. Only global or local installations. Using nvm
you have the PATH problems because we would need to read the PATH environment variable per working dir. https://github.com/SublimeLinter/SublimeLinter/issues/1795 would solve that.
You can just try and see it in the logs if it chooses eslint_d
.
I might be wrong and just missing config, but I'm trying to get a monorepo working with eslint and I can't seem to get
SublimeLinter-eslint
working correctly, which I think comes down to the CWD. From my question this should be set based on thepackage.json
. So my structure is as follows:However if I'm interpreting the logs correctly, it looks like the CWD is just being set to the root
webclient
.