LSP-typescript: Using Flow in React Project. Type annotations can only be used in TypeScript files error.
In my react\javascript project i use Flow, and often get this error:
error Type annotations can only be used in TypeScript files. typescript:8010
How can i disable it?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (15 by maintainers)
It’s a problem that both plain JS and flow use the same syntax since the syntax (or its root scope) is currently the way to map language servers to files that they run on.
The only solution I can think of is to:
// @flow.Wow, that’s great, thank you! However, looking at ST’s docs,
first_line_matchcomes into play only whena file is opened without a recognized extension. That wouldn’t work for.jsfiles, no?Good idea. I’ve added a
first_line_matchoption to JS Custom and you can try it out in v4.2.0-beta.5.