Skip to content

Commit

Permalink
tools: custom eslint autofix for inspector-check.js
Browse files Browse the repository at this point in the history
rules-utils arguments check + spacing in test file

Refs: nodejs#16636
  • Loading branch information
shobhitchittora committed Feb 17, 2018
1 parent c4b5e8b commit 3b1ce16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-eslint-inspector-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ new RuleTester().run('inspector-check', rule, {
valid: [
'foo;',
'require("common")\n' +
'common.skipIfInspectorDisabled();\n' +
'require("inspector")'
'common.skipIfInspectorDisabled();\n' +
'require("inspector")'
],
invalid: [
{
Expand Down
1 change: 1 addition & 0 deletions tools/eslint-rules/rules-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports.isBinding = function(node, modules) {
var commonModuleRegExp = new RegExp(/^(\.\.\/)*common(\.js)?$/);
module.exports.isCommonModule = function(node) {
return node.callee.name === 'require' &&
node.arguments.length !== 0 &&
commonModuleRegExp.test(node.arguments[0].value);
};

Expand Down

0 comments on commit 3b1ce16

Please sign in to comment.