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

feat: add fixer for requireValidFileAnnotation when always #332

Merged

Conversation

KevinGrandon
Copy link
Contributor

If folks add 'always' to their eslint config we can infer that they generally want flow coverage in their codebases. As such, we should be able to autofix files by adding the annotation to make their lives easier.

@KevinGrandon KevinGrandon changed the title Add fixer for requireValidFileAnnotation when always feat: add fixer for requireValidFileAnnotation when always May 21, 2018
@gajus
Copy link
Owner

gajus commented May 21, 2018

If file starts with /* eslint-disable require-valid-annotation-flow-autofix */, then the fix should not be applied. Otherwise, there will be no way to suppress this fix for specific files.

@KevinGrandon
Copy link
Contributor Author

If file starts with /* eslint-disable require-valid-annotation-flow-autofix */, then the fix should not be applied. Otherwise, there will be no way to suppress this fix for specific files.

Thank you for chiming in and sorry for the slow follow-up. Would you happen to have an example of an eslint plugin that does this?

I think that another way to prevent autofixing of files would be to add a // @noflow file declaration to the top of the file? Happy to add some documentation if that would be sufficient?

@gajus
Copy link
Owner

gajus commented May 25, 2018

I think that another way to prevent autofixing of files would be to add a // @noflow file declaration to the top of the file?

Sounds reasonable.

@KevinGrandon
Copy link
Contributor Author

@gajus - Added a note in the README about autofixing, and how to avoid autofixing this rule per-file. Is there anything else you were looking for here?

@gajus gajus merged commit 51f4ba2 into gajus:master May 29, 2018
@gajus
Copy link
Owner

gajus commented May 29, 2018

Thank you

@gajus
Copy link
Owner

gajus commented May 29, 2018

🎉 This PR is included in version 2.48.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants