diff --git a/src/rules/noFlowFixMeComments.js b/src/rules/noFlowFixMeComments.js index e9c679bb..72cb6b80 100644 --- a/src/rules/noFlowFixMeComments.js +++ b/src/rules/noFlowFixMeComments.js @@ -31,8 +31,7 @@ const create = (context) => { }; return { - BlockComment: handleComment, - GenericTypeAnnotation: (node) => { + GenericTypeAnnotation (node) { if (isIdentifier(node.id, /\$FlowFixMe/)) { context.report({ message, @@ -40,7 +39,16 @@ const create = (context) => { }); } }, - LineComment: handleComment + + Program () { + context + .getSourceCode() + .getAllComments() + .filter((comment) => { + return comment.type === 'Block' || comment.type === 'Line'; + }) + .forEach(handleComment); + } }; };