eslint-plugin-flowtype icon indicating copy to clipboard operation
eslint-plugin-flowtype copied to clipboard

Add rule to enforce error codes on flow suppressions

Open christianvuerings opened this issue 4 years ago • 2 comments

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

christianvuerings avatar Aug 19 '20 16:08 christianvuerings

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 avatar Feb 24 '21 20:02 Brianzchen

@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 or error in ESLint
  • ESLint violations do show up in VSCode

christianvuerings avatar Feb 24 '21 21:02 christianvuerings