Closed noelweichbrodt closed 1 month ago
Inexplicable update: after restarting (SPC q r
) a couple of times to disable typescript
layer entirely and then put it back in, I'm now seeing this in tsx
files:
Syntax checkers for buffer Login.tsx in typescript-tsx-mode:
First checker to run:
lsp (explicitly selected)
- may enable: yes
- may run: t
Checkers that could run if selected:
javascript-eslint select
- may enable: yes
- executable: Found at /Users/noel/w/project/node_modules/.bin/eslint
- config file: found
Flycheck Mode is enabled. Use M-m u M-m e d to enable disabled checkers.
--------------------
Flycheck version: 20240307.2106
Emacs version: 29.2
System: aarch64-apple-darwin23.3.0
Window system: ns
So of course, I select
javascript-eslint
:
Syntax checkers for buffer LoginForm.tsx in typescript-tsx-mode:
First checker to run:
javascript-eslint (explicitly selected)
- may enable: yes
- executable: Found at /Users/noel/w/project/node_modules/.bin/eslint
- config file: found
Checkers that could run if selected:
lsp select
- may enable: yes
- may run: t
Flycheck Mode is enabled. Use M-m u M-m e d to enable disabled checkers.
--------------------
Flycheck version: 20240307.2106
Emacs version: 29.2
System: aarch64-apple-darwin23.3.0
Window system: ns
However, any flycheck action still shows the same error as above:
LSP :: Error from the Language Server: Request textDocument/codeAction failed with message: No ESLint configuration found in /Users/noel/w/project/app/login/components. (Internal Error)
And of course, if I remove my explicit setq exec-path
for the project, flycheck is not longer able to find the eslint executable or project config:
Syntax checkers for buffer LoginForm.tsx in typescript-tsx-mode:
First checker to run:
lsp (explicitly selected)
- may enable: yes
- may run: t
Checkers that are compatible with this mode, but will not run until properly configured:
javascript-eslint (automatically disabled) reset
- may enable: no
- executable: Not found
- config file: missing or incorrect
Flycheck Mode is enabled. Use M-m u M-m e d to enable disabled checkers.
--------------------
Flycheck version: 20240307.2106
Emacs version: 29.2
System: aarch64-apple-darwin23.3.0
Window system: ns
Might be related to this
I am not working with typescript but judging from the output of flycheck I assume you have configured the local flycheck checker for eslint. But that's not used at all as your lsp server is calling flycheck to do the linting.
Therefore you need to check the lsp mode documentation how to tell your lsp server where to look for eslint instead.
I found https://github.com/syl20bnr/spacemacs/issues/10131, which seemed like it directly addressed my issue, so I followed the solution there to utilize
add-node-modules-path
to load the project's local ESLint, however the error persisted. I tried explicitly setting(setq exec-path (append '("/Users/noel/w/project/node_modules/.bin") exec-path))
, but the error persisted. Now I'm out of ideas 😓Here's the flycheck-verify-setup:
And for context, my config:
dotspacemacs-configuration-layers
:user-config
:Finally, for the paranoid, there is in fact ESLint installed in the project:
…and in
javascript
mode flycheck can find it: