Skip to content

Commit

Permalink
fix: Fix $FlowFixMe comments for eslint 4 (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnevyk authored and gajus committed Jun 1, 2018
1 parent 7c57cea commit 647807f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/rules/noFlowFixMeComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,24 @@ const create = (context) => {
};

return {
BlockComment: handleComment,
GenericTypeAnnotation: (node) => {
GenericTypeAnnotation (node) {
if (isIdentifier(node.id, /\$FlowFixMe/)) {
context.report({
message,
node: node.id
});
}
},
LineComment: handleComment

Program () {
context
.getSourceCode()
.getAllComments()
.filter((comment) => {
return comment.type === 'Block' || comment.type === 'Line';
})
.forEach(handleComment);
}
};
};

Expand Down

0 comments on commit 647807f

Please sign in to comment.