quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.52k stars 191 forks source link

feature request: treat Flow files as TypeScript #1178

Open vegerot opened 7 months ago

vegerot commented 7 months ago

Flow files frequently have // @flow annotations at the top of them. From my testing, telling quick-lint that flow files are typescript(react) doesn't add any false positives.

While not perfect, it's better than nothing.

Request: When quick-lint sees a @flow annotation, treat it as TypeScript

strager commented 7 months ago

Flow files should be treated as Flow, not TypeScript. There are important differences in syntax.

I do not plan on implementing Flow parsing support in quick-lint-js any time soon. However, quick-lint-js should probably detect @flow and not parse the file in this case. Would that be a good enough solution for you?

vegerot commented 7 months ago

quick-lint-js should probably detect @flow and not parse the file in this case. Would that be a good enough solution for you?

No. This would break my current workaround of :set ft=typescriptreact. quick-lint works well enough for the flow project I'm working on (React)