SublimeLinter / SublimeLinter-flow

SublimeLinter plugin for JavaScript static type checking, using flow.
MIT License
116 stars 24 forks source link

Flow Comment Type support? #54

Closed brownieboy closed 7 years ago

brownieboy commented 7 years ago

Does SublimeLinter-flow support Flow's comment-based syntax?

I'm finding that it's giving me "Missing Type Annotation" errors for code like this:

// @flow
import React from "react";
import type { Element } from "react";

const InputField = (value /*: string */)/*: Element<*> */ => <input value={ value } />;

But if I remove the comments from the annotations, it passes Flow validation just fine.

brownieboy commented 7 years ago

My bad.

I actually had two linters enabled under Tools->SublimeLinter Toggler Linter. These were "eslint" and "flow", with "flow" being the SublimeLinter-Flow package. And it was actually the eslint linter rather than the flow linter that was giving me the errors above. The flow linter enabled on its own works just fine, recognising my comment style annotations and flagging errors when I tried to remove them.

But now I've lost all my other eslint linting! I need to find some way to make them work together, I guess.

Update Doh! I forgot that I'd actually added the flowtype plugin to my .eslintrc file, along with load of its rules. It's that plugin that doesn't support Flow's comment-based syntax, see https://github.com/gajus/eslint-plugin-flowtype/issues/87.

Once I'd removed the flowtype references from my .eslintrc file, I was able to toggle eslint back on without it giving me bogus Flow errors.

revolunet commented 6 years ago

Hi, how does the Comment type support handle Types in multiple files ? looks like i have to duplicate the definitions :/