neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.06k stars 68 forks source link

Javascript linting doesn't catch undefined variables #404

Closed t-mdo closed 1 year ago

t-mdo commented 1 year ago

Hey there,

I've been using coc.nvim for a while with coc-tsserver, and I've just noticed that nvim was not underlining as error variables that were used but not defined in scope.

Eg: I'm calling a function I haven't imported yet, no errors in vim.

I've edited a simple javascript file to see if that was my react setup, but I can reproduce it with a simple javascript one-liner:

console.log(undefined_variable) yields no error.

The linting seems to be working fine to spot other types of errors. Any ideas where this could come from?

EDIT: Here's my CocConfig:

{
  "coc.preferences.formatOnSaveFiletypes": ["html", "css", "ruby", "javascript"],
  "suggest.enablePreselect": false,
  "suggest.noselect": true
}
chemzqm commented 1 year ago

https://github.com/neoclide/coc-tsserver#troubleshooting

chemzqm commented 1 year ago

It's expected, tsserver doesn't check javascript by default.

t-mdo commented 1 year ago

Okay got it, it was my eslint configuration that blocked coc-eslint from doing its job. Got confused about which modules had which responsability. Sorry for the noise.

Cheers,