-
Notifications
You must be signed in to change notification settings - Fork 48
Linting Types is Overstepping #19
Comments
Can you provide a screen-shot? |
I see. The underlying TypeScript language server isn't capable of ignoring Flow annotations unfortunately. It can treat files as plain JS or as TypeScript but not Flow. You are best off using ide-flow if you are editing flow code. If you also want ide-typescript installed for typescript files you can turn off JS entirely for it from the Atom Settings page under ide-typescript. |
But in a project that isn't using Typescript it shouldn't complain about type annotations in JS files. |
The problem is a javascript file with flow type annotations isn't plain javascript. |
I should clarify - if this was easy to achieve we would still do it. Unfortunately it's a limitation of the underlying language server that does all the hard work (Microsoft's TypeScript server) |
There's no way to enable the JS portions of the server without the TypeScript portions? You have the checkbox in the settings for JS. |
No. |
@wldcordeiro The reason that can't be done is there are no "JS portions of the server". The LSP treats all code as TypeScript, it just happens to somewhat work for JS as TypeScript is for the most part a superset of JS. Where it fails is when you start using parts of JS (or non-JS like Flow) that TypeScript doesn't support. |
Flow files should be annotated with |
@skylize The 'hard' part about that is we don't own the typescript server - Microsoft does. They'll need to support it. |
Ah, I see. And looking at your code I don't see anywhere the text content passes through for you to check it. Worth recording here that this has been raised already upstream. |
I'm using this server to get just the JavaScript features and have the flow server installed as well. I'm getting errors about defining flow types in my JS files. There should be some better detection of typescript before it applies the linting rule.
The text was updated successfully, but these errors were encountered: