Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update looksLikeFlowFileAnnotation regex to match only @flow #233

Merged
merged 1 commit into from
May 30, 2017

Conversation

Robdel12
Copy link
Contributor

The looksLikeFlowFileAnnotation regex was too broad and would catch
jsdoc comments like @fixable and @function, causing eslint errors
in projects that don't use flow (in my case).

I updated the regex to only check for anything beginning with
@flo. Is there any reason not to full on match @flow? I'm not
familiar with how flow works.

This should fix #165.

The `looksLikeFlowFileAnnotation` regex was too broad and would catch
jsdoc comments like `@fixable` and `@function`, causing eslint errors
in projects that don't use flow (in my case).

I updated the regex to only check for anything beginning with
`@flo`. Is there any reason not to full on match `@flow`? I'm not
familiar with how flow works.

This should fix gajus#165.
@sunnyvempati
Copy link

can we get this merged?

@gajus
Copy link
Owner

gajus commented May 28, 2017

I am reluctant to, as I've never run into this situation working on large projects. I'd rather recommend disabling the rule in effected files. Alternatively, regex could be provided as an option.

@Robdel12
Copy link
Contributor Author

Thankfully this rule was (temporarily) disabled from create react app, so it might make it easier to ignore this.

I ran into this immediately since I had JSdocs that included @function and it triggered a match on this regex. Which caused flow eslint errors when I don't even use flow.

@danharper
Copy link
Collaborator

👍 for merging this

@gajus gajus merged commit 42328cd into gajus:master May 30, 2017
@Robdel12
Copy link
Contributor Author

Thanks! 😃

@gajus
Copy link
Owner

gajus commented May 30, 2017

@danharper Dan has veto rights here. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

require-valid-file-annotation is too aggressive
4 participants