github-pages-deploy-action/node_modules/eslint-plugin-github/lib/rules/no-flow-weak.js

25 lines
533 B
JavaScript
Raw Normal View History

2020-03-07 11:45:40 +08:00
module.exports = {
meta: {
docs: {},
schema: []
},
create(context) {
function handleComment(comment) {
var value = comment.value.trim()
if (value.match(/@flow weak/)) {
context.report(comment, "Do not use Flow 'weak' mode checking, use @flow instead.")
}
}
return {
LineComment: handleComment,
BlockComment: handleComment,
Program() {
const comments = context.getSourceCode().getAllComments()
comments.forEach(handleComment)
}
}
}
}