Skip to content

Commit 647807f

Browse files
pnevykgajus
authored andcommitted
fix: Fix $FlowFixMe comments for eslint 4 (#338)
1 parent 7c57cea commit 647807f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Diff for: src/rules/noFlowFixMeComments.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,24 @@ const create = (context) => {
3131
};
3232

3333
return {
34-
BlockComment: handleComment,
35-
GenericTypeAnnotation: (node) => {
34+
GenericTypeAnnotation (node) {
3635
if (isIdentifier(node.id, /\$FlowFixMe/)) {
3736
context.report({
3837
message,
3938
node: node.id
4039
});
4140
}
4241
},
43-
LineComment: handleComment
42+
43+
Program () {
44+
context
45+
.getSourceCode()
46+
.getAllComments()
47+
.filter((comment) => {
48+
return comment.type === 'Block' || comment.type === 'Line';
49+
})
50+
.forEach(handleComment);
51+
}
4452
};
4553
};
4654

0 commit comments

Comments
 (0)