jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

JSCS v3 does not play well with Flow #2251

Closed UnsungHero97 closed 8 years ago

UnsungHero97 commented 8 years ago

I'm using JSCS v3 with the Airbnb preset, pulling in the latest changes on master (9eaa1f7c619a356b4d887c60760d2eb36543a59f), and I'm seeing the following error:

Expected end of node list but "Whitespace" found at src/utils.js :
     1 |/*
--------^
     2 | * @flow
     3 | */

This is the entirety of the file I'm trying to lint:

/*
 * @flow
 */

export function isValid(key :?Uint8Array) :boolean {
  return key instanceof Uint8Array;
}

If I remove the Flow type annotations, JSCS has no problem with the file. It seems like JSCS v3 is not playing well with Flow.

hzoo commented 8 years ago

Oh yeah, cst itself doesn't support flow atm

UnsungHero97 commented 8 years ago

@hzoo thanks for the quick response! so what's the plan going forward? should I expect Flow support in JSCS v3, or is that too big of a feature for a product at EOL?

hzoo commented 8 years ago

It's a CST change, so it depends on if anyone wants to make a PR for it (I don't think there needs to much change in JSCS itself if at all). It could definetely happen if anyone is up to do a PR in that repo.

https://github.com/cst/cst/issues/120

UnsungHero97 commented 8 years ago

will the changes to CST eventually go in ESLint, when ESLint switches over to CST? if so, it seems like a good use of time for this to eventually be implemented :)

markelog commented 8 years ago

will the changes to CST eventually go in ESLint, when ESLint switches over to CST?

To note: that's an "if" and pretty big one :)