facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 682 forks source link

Linting results are not shown with tree-sitter + flow scope #1630

Open IanVS opened 5 years ago

IanVS commented 5 years ago

Issue and Steps to Reproduce

ESLint errors are not shown in the diagnostics pane when tree-sitter is enabled and flow is used.

I'm using linter-eslint with default scopes (includes source.js, but not source.flow), and linter package disabled. I noticed that after tree-sitter was enabled by default (I'm using atom-beta), linting stopped working on most of my files. After experimenting, it seems that it's the combination of tree-sitter, flow, and nuclide. See screenshots below. I restarted atom after making changes, to verify all settings are applied correctly. I also noticed that if I add the source.flow scope to linter-eslint and restart, nuclide will report eslint errors. That scope is not required for linter errors to be displayed when using the linter package, so there's definitely something wonky going on in nuclide.

Expected Behavior

Linting results from eslint should be shown in the diagnostics along with flow errors.

Actual Behavior

Only flow errors are shown.

With flow and tree sitter:

image

After removing flow pragma, closing the file, and re-opening:

image

With flow and tree sitter, but using linter instead of nuclide (after a restart of atom):

image

Versions

Additional Details

IanVS commented 5 years ago

Perhaps this is related to https://github.com/facebook-atom/atom-ide-ui/issues/144? Is nuclide only using the first scope? The scopes I'm getting on that file are:

source.flow
source.js
Chaoste commented 5 years ago

I can reproduce this issue but adapting the eslint scope to also listen to flow files doesn't work.

Update: I was wrong. After reinstalling packages, altering the settings, etc. I just figured out that it now just tooks about 10 seconds to show the errors ^^

IanVS commented 5 years ago

It seems that in atom 1.33.0-beta1, the source.js scope is no longer included at all in files using flow, which also happened to break all my snippets. (https://github.com/atom/atom/issues/18398)

gajus commented 5 years ago

@IanVS Did you find a solution to make linting work?

IanVS commented 5 years ago

Yes, you can add source.flow to the list of scopes to lint in the linter-eslint settings. In the next release of linter-eslint, it will be included by default.

gajus commented 5 years ago

Yes, you can add source.flow to the list of scopes to lint in the linter-eslint settings. In the next release of linter-eslint, it will be included by default.

I ended up disabling Nuclide altogether in favour of atom-ide-ui + ide-flowtype.

It appears that linter-eslint is compatible with atom-ide-ui out of the box.