Skip to content

Commit ceeae4b

Browse files
Trottevanlucas
authored andcommitted
tools,test: make argument linting more stringent
The custom linting rule for argument alignment in multi-line function calls previously ignored template strings in an effort to avoid false positives. This isn't really necessary. Enforce for template strings and adjust whitespace in three tests to abide. (Insert "The test abides" joke of your choosing here.) PR-URL: #6720 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 6d1527b commit ceeae4b

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

test/parallel/test-assert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ try {
376376
} catch (e) {
377377
threw = true;
378378
assert(e instanceof AnotherErrorType,
379-
`expected AnotherErrorType, received ${e}`);
379+
`expected AnotherErrorType, received ${e}`);
380380
}
381381

382382
assert.ok(threw);

test/parallel/test-net-pipe-connect-errors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var notSocketClient = net.createConnection(emptyTxt, function() {
4545

4646
notSocketClient.on('error', function(err) {
4747
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED',
48-
`received ${err.code} instead of ENOTSOCK or ECONNREFUSED`);
48+
`received ${err.code} instead of ENOTSOCK or ECONNREFUSED`);
4949
notSocketErrorFired = true;
5050
});
5151

test/parallel/test-tick-processor.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ process.chdir(common.tmpDir);
1919
// Unknown checked for to prevent flakiness, if pattern is not found,
2020
// then a large number of unknown ticks should be present
2121
runTest(/LazyCompile.*\[eval\]:1|.*% UNKNOWN/,
22-
`function f() {
23-
for (var i = 0; i < 1000000; i++) {
24-
i++;
25-
}
26-
setImmediate(function() { f(); });
27-
};
28-
setTimeout(function() { process.exit(0); }, 2000);
29-
f();`);
22+
`function f() {
23+
for (var i = 0; i < 1000000; i++) {
24+
i++;
25+
}
26+
setImmediate(function() { f(); });
27+
};
28+
setTimeout(function() { process.exit(0); }, 2000);
29+
f();`);
3030
if (common.isWindows ||
3131
common.isSunOS ||
3232
common.isAix ||
@@ -36,12 +36,12 @@ if (common.isWindows ||
3636
return;
3737
}
3838
runTest(/RunInDebugContext/,
39-
`function f() {
40-
require(\'vm\').runInDebugContext(\'Debug\');
41-
setImmediate(function() { f(); });
42-
};
43-
setTimeout(function() { process.exit(0); }, 2000);
44-
f();`);
39+
`function f() {
40+
require(\'vm\').runInDebugContext(\'Debug\');
41+
setImmediate(function() { f(); });
42+
};
43+
setTimeout(function() { process.exit(0); }, 2000);
44+
f();`);
4545

4646
function runTest(pattern, code) {
4747
cp.execFileSync(process.execPath, ['-prof', '-pe', code]);

tools/eslint-rules/align-function-arguments.js

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ function checkArgumentAlignment(context, node) {
3333
'CallExpression',
3434
'FunctionExpression',
3535
'ObjectExpression',
36-
'TemplateLiteral'
3736
];
3837

3938
const args = node.arguments;

0 commit comments

Comments
 (0)