How to make ESlint work

Hi,

In the Eslint config I have entered this path:

C:\www\docker-projects\mercury-frontend\node_modules\eslint (Project specific eslint library)

I Also tried this path:

C:\Users\Rick\node_modules\eslint (Windows global Eslint library)

I notice windows permission errors in the komodo log when it tries to lint. (See below).

I don’t know where the permission problem lies exactly, I have checked both eslint folders and the permissions look ok, unless I’m missing something?

Any ideas of how to fix this?
Thanks

Komodo Error:

WindowsError: [Error 5] Access is denied
[2018-09-19 13:34:05,101] [ERROR] koLintService: lint_with_text exception
Traceback (most recent call last):
File “C:\Program Files (x86)\ActiveState Komodo IDE 11\lib\mozilla\components\koLintService.py”, line 172, in lint_with_text
newLintResults = UnwrapObject(linter).lint_with_text(request, text)
File “C:\Program Files (x86)\ActiveState Komodo IDE 11\lib\mozilla\components\koESLintLinter.py”, line 105, in lint_with_text
p = process.ProcessOpen(cmd, cwd=cwd, env=env, stdin=process.PIPE)
File “C:\Program Files (x86)\ActiveState Komodo IDE 11\lib\mozilla\python\xpcom\components.py”, line 263, in wrapperFn
threadMgr.mainThread.dispatch(method, dispatch_flags)
File “<XPCOMObject method ‘dispatch’>”, line 3, in dispatch
Exception: 2147500037 (NS_ERROR_FAILURE)

What is the actually issue you’re experiencing? Is linting not working?

As far as I know it is not working.

In .js files I still get some JSlint errors & warnings, but I never get any ESlint errors / warnings in .js or .jsx files. I have eslint in my console and I never see those erorrs / warnings displayed in the files in Komodo IDE.

I have also reported a bug about the syntax highlighting not working well in .jsx files, but not sure if it’s related to ESlint not working. Could be a seperate issue, but I will add the link here as there is a screenshot of how I configured ESlint.

Try pointing at the ESlint binary rather than the ESlinter install dir. I was confused by the Prefs UI and thought I could just point it at the node_modules dir like the example text suggests but it’s looking for a binary. You can find the eslint binary in node_modules\.bin. I realized I couldn’t set a dir because the browse button wants your to select a file.

You should use the browse buttons we provide as it indicates what is expected in the field but that UX needs work so I don’t blame you for pasting in the path you did.

  • cAREY

ps. See if this also resolves the bug your reported.

Ok, I have now pointed to the correct path / eslint binary, and noticed a new exception in the log. It still doesn’t seem to be working.

Error:
WindowsError: [Error 193] %1 is not a valid Win32 application
[2018-09-20 10:08:49,365] [ERROR] koLintService: lint_with_text exception
Traceback (most recent call last):
File “C:\Program Files (x86)\ActiveState Komodo IDE 11\lib\mozilla\components\koLintService.py”, line 172, in lint_with_text
newLintResults = UnwrapObject(linter).lint_with_text(request, text)
File “C:\Program Files (x86)\ActiveState Komodo IDE 11\lib\mozilla\components\koESLintLinter.py”, line 105, in lint_with_text
p = process.ProcessOpen(cmd, cwd=cwd, env=env, stdin=process.PIPE)
File “C:\Program Files (x86)\ActiveState Komodo IDE 11\lib\mozilla\python\xpcom\components.py”, line 263, in wrapperFn
threadMgr.mainThread.dispatch(method, dispatch_flags)
File “<XPCOMObject method ‘dispatch’>”, line 3, in dispatch
Exception: 2147500037 (NS_ERROR_FAILURE)

@stereofx, wrong file. There should be an eslint.cmd file.

Lol, my bad. So confusing :slight_smile:

Great, now I have pointed to the correct file, and it does seem to be doing something now, but still not working, here is the new outpout of the log: (I will keep an eye on it today and post updates if anything new turns up in the log).

On the plus side, the syntax highlighting seems to be much better. I will keep an eye on that and update the bug report when I’m confident it’s working 100%.

[2018-09-21 10:23:58,782] [INFO] codeintel/process: CodeIntel started on port 56169
[2018-09-21 10:23:58,783] [DEBUG] codeintel/process: Calling callbacks for: started, number: 1
[2018-09-21 10:23:59,392] [DEBUG] ko.launch: Response: http://docs.komodoide.com/omnigollum/auth/github?origin=%2Fcreate%2Fchangelog%2F111 (404)
[2018-09-21 10:24:30,451] [WARNING] console-logger: Key event not available on GTK2: key=“u” modifiers=“control,shift” (1) in chrome://komodo/content/komodo.xul:0
[2018-09-21 10:24:48,845] [WARNING] koEsLintLinter: Failed to parse the eslint output!
[2018-09-21 10:24:48,845] [WARNING] koEsLintLinter: The output was:
[2018-09-21 10:25:01,232] [WARNING] koEsLintLinter: Failed to parse the eslint output!
[2018-09-21 10:25:01,233] [WARNING] koEsLintLinter: The output was:
[2018-09-21 10:25:54,992] [WARNING] koEsLintLinter: Failed to parse the eslint output!
[2018-09-21 10:25:54,992] [WARNING] koEsLintLinter: The output was:
[2018-09-21 10:26:02,980] [WARNING] koEsLintLinter: Failed to parse the eslint output!
[2018-09-21 10:26:02,982] [WARNING] koEsLintLinter: The output was:
[2018-09-21 10:26:11,246] [WARNING] koEsLintLinter: Failed to parse the eslint output!
[2018-09-21 10:26:11,246] [WARNING] koEsLintLinter: The output was:
[2018-09-21 10:27:23,808] [WARNING] console-logger: Key event not available on GTK2: key=“u” modifiers=“control,shift” (1) in chrome://komodo/content/tail/tail.xul:0

@careyh any idea why the eslint output is failing? Should I open a new bug report or is there anything else I can do to try get it working?

Thanks.

@stereofx, sorry for the delay. Without looking at code I can’t say what might be going on. Id’ say file a new bug.

  • Carey

You can increase koESLintLinter logging verbosity (koEsLintLinter) up to debug mode, but I don’t remember how.

The code that handles ESLint exceptions is there: https://github.com/Komodo/KomodoEdit/blob/master/src/lint/koESLintLinter.py#L113

Once you enable debug logging, you should get both stdout and stderr in your logs that may contain some useful information.