-
Notifications
You must be signed in to change notification settings - Fork 10
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
Suggested improvements to no-flow-fix-me-in-strict-files
rule
#14
Comments
So for the first one, you're naming a type variable as For your second case, you've made this file strict though you want to have suppression errors which is an anti pattern as per the docs. Any chance you'd consider removing strict mode on these flow tests you run, maybe it doesn't make sense there? Or maybe the rule just doesn't make sense for your codebase which is fine since it's not part of recommended config 🙂 Tagging original author in case he has any ideas @nvie since tbh I don't use strict mode. |
In this case I didn't realize it's not built-in like other suppressions so I think this should be configurable.
I agree with the statement for normal files. But the docs are also saying "just add |
oh wow learning something new everyday, On the point of this rule it should not handle usage of For your suppression errors in flow strict files we can add an option to this rule that takes an array of ignored dirs? Let me know what you think of these ideas. |
I have another improvement to this rule before I address your comments: I think the rule name
Here is my point of view: On the other hand, Flow doesn't allow
I thought that ignoring |
yes I had the same thought.. Maybe worth opening another issue for this I'm not sure of the impacts of changing it, it would be a breaking change for anyone using it. Though could be a now or never update since this lib isn't that hugely used yet...
The alternative is to follow the pattern of I'm happy to implement this one if it suits you? |
Additionally to this option object we could add Overall the rule structure would be used like
|
Done: #17
Sounds good to me. 👍
This might not be necessary once we can do |
I think this rule is a really good idea. I have a suggestion for improvements though before I can enable it in our codebase. For example, this should be an error (I actually thought this is what the rule is supposed to catch):
Flow is happy, Eslint rule is happy (it should not be). Another example which I think is wrong is this:
It's wrong because it's a Flow test (
__flowtests__/test.js
) and the error is expected to happen ($FlowExpectedError
). In other words, it's correct that Flow complains here (I marked it as expected) but it doesn't mean the file cannot be strict. This case is actually very common in our codebase where we have many strictly typed flow test files. It would be correct if the suppression was for example$FlowFixMe
or$FlowIssue
.What do you think about this?
The text was updated successfully, but these errors were encountered: