Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tools/eslint-rules/inspector-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const msg = 'Please add a skipIfInspectorDisabled() call to allow this ' +
'test to be skippped when Node is built \'--without-inspector\'.';

module.exports = function(context) {
var usesInspector = false;
const missingCheckNodes = [];
var hasInspectorCheck = false;

function testInspectorUsage(context, node) {
if (utils.isRequired(node, ['inspector'])) {
usesInspector = true;
missingCheckNodes.push(node);
}
}

Expand All @@ -30,8 +30,10 @@ module.exports = function(context) {
}

function reportIfMissing(context, node) {
if (usesInspector && !hasInspectorCheck) {
context.report(node, msg);
if (!hasInspectorCheck) {
missingCheckNodes.forEach((node) => {
context.report(node, msg);
});
}
}

Expand Down