Flowtype support in linter

typescript
reactjs
javascript
linting

#1

The current linter does not support flowtype (or other eslint plugins that require other parser than the default, e.g. typescript).

A simple and painless solution would be to detect if the parser is overridden in .eslintrc and then fall back to server-side linting. That would be really nice and seamless, although a bit slower. (Currently an overridden parser is simply ignored.)


#2

or more simply, have an option to use a server-side linter for javascript (just like it is for python)


#3

I’ve solved it :slight_smile: . I wrote a server-side eslint plugin and also a flowtype plugin:



#4

Awesome! Great work :slight_smile:


#5

@cie Very cool! Did you have a look at https://cloud9-sdk.readme.io/docs/existing-tools and try workerUtil.execAnalysis() for this? It’s quite a bit faster for this use case and would help check unsaved changes.


#6

Thanks :slight_smile:
Actually, I was trying to do it with execAnalysis(), and i spent hours with trying to make it faster, but for some reason there was always some kind of timeout and sometimes it took 10-30 seconds to get a response. What I’m doing now is execFile with sending the whole contents in a bash command line in every round trip. I know this is ugly, but for me it works with 1-3 second response times, and it works with the unsaved changes taken into account. Sorry, but I had enough of trying to do it the nice way :S .

BTW, today I updated it with autocomplete and jump-to-definition too! :champagne:


#7

Take a look at this plugin I wrote to run external eslint, it uses eslint_d to make the linting much much quicker, sometimes sub 50ms.


#8

Is this, cie/cie.flowtype the best way to support flowtype? If it is I’m not sure how to use it. The instructions for cie/cie.eslint say:
This is a Cloud9 plugin that uses an external eslint found on PATH, and an .eslintrc found in an ancestor folder of the current file, to check the file contents.

Does this mean I should install eslint and add it to PATH and the Cloud9 IDE will use it or is it strictly for command line usage?