eslint-plugin-flowtype
eslint-plugin-flowtype copied to clipboard
Add rule to enforce error codes on flow suppressions
Flow version 0.121.0 allows for more specific error suppressions: https://medium.com/flow-type/making-flow-error-suppressions-more-specific-280aa4e3c95c
It would be wonderful if we could have a rule which requires these specific error suppressions:
-
// $FlowFixMe
would fail since it has no valid error code specified -
// $FlowFixMe[incompatible-type]
would pass since it does have a valid error code
Flow can enforce this with their configs, include_warnings=true
option. Would this lint rule still be necessary? Although flow doesn't highlight warnings in vscode which is a bit annoying.
Thoughts @christianvuerings ?
@Brianzchen We already have include_warnings=true
in our config but it would still be great to have the error code enforcement as an ESLint rule as well since:
- We can set it as
warning
orerror
in ESLint - ESLint violations do show up in VSCode