eslint-plugin-no-loops
Version:
18 lines (15 loc) • 416 B
JavaScript
;
module.exports = {
create(context) {
function reportLoopPresence(node) {
context.report(node, 'loops are not allowed', { identifier: node.name });
}
return {
ForStatement: reportLoopPresence,
ForInStatement: reportLoopPresence,
WhileStatement: reportLoopPresence,
DoWhileStatement: reportLoopPresence,
ForOfStatement: reportLoopPresence
};
}
}