Skip to content

Commit 419e88e

Browse files
Trotttargos
authored andcommitted
lib,test: lint fixes for linter upgrade
ESLint 4.19.1 fixes some bugs in rules. These changes prepare us for the upgrade. PR-URL: #19528 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent ae0e243 commit 419e88e

File tree

5 files changed

+31
-26
lines changed

5 files changed

+31
-26
lines changed

lib/_http_client.js

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function ClientRequest(options, cb) {
121121
if (path.length <= 39) { // Determined experimentally in V8 5.4
122122
invalidPath = isInvalidPath(path);
123123
} else {
124+
// eslint-disable-next-line no-control-regex
124125
invalidPath = /[\u0000-\u0020]/.test(path);
125126
}
126127
if (invalidPath)

lib/internal/readline.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
// Adopted from https://github.com/chalk/ansi-regex/blob/master/index.js
55
// License: MIT, authors: @sindresorhus, Qix-, and arjunmehta
66
// Matches all ansi escape code sequences in a string
7+
/* eslint-disable no-control-regex */
78
const ansi =
89
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
10+
/* eslint-enable no-control-regex */
911

1012
const kEscape = '\x1b';
1113

lib/internal/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const noCrypto = !process.versions.openssl;
1212

1313
const experimentalWarnings = new Set();
1414

15-
const colorRegExp = /\u001b\[\d\d?m/g;
15+
const colorRegExp = /\u001b\[\d\d?m/g; // eslint-disable-line no-control-regex
1616

1717
function removeColors(str) {
1818
return str.replace(colorRegExp, '');

test/parallel/test-require-nul.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ require('../common');
44
const assert = require('assert');
55

66
// Nul bytes should throw, not abort.
7+
/* eslint-disable no-control-regex */
78
assert.throws(() => require('\u0000ab'), /Cannot find module '\u0000ab'/);
89
assert.throws(() => require('a\u0000b'), /Cannot find module 'a\u0000b'/);
910
assert.throws(() => require('ab\u0000'), /Cannot find module 'ab\u0000'/);
11+
/* eslint-enable no-control-regex */

test/parallel/test-tls-client-verify.js

+25-25
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,37 @@ const assert = require('assert');
2828
const tls = require('tls');
2929
const fixtures = require('../common/fixtures');
3030

31-
const testCases =
32-
[{ ca: ['ca1-cert'],
33-
key: 'agent2-key',
34-
cert: 'agent2-cert',
35-
servers: [
31+
const testCases = [
32+
{ ca: ['ca1-cert'],
33+
key: 'agent2-key',
34+
cert: 'agent2-cert',
35+
servers: [
3636
{ ok: true, key: 'agent1-key', cert: 'agent1-cert' },
3737
{ ok: false, key: 'agent2-key', cert: 'agent2-cert' },
3838
{ ok: false, key: 'agent3-key', cert: 'agent3-cert' }
3939
]
4040
},
4141

42-
{ ca: [],
43-
key: 'agent2-key',
44-
cert: 'agent2-cert',
45-
servers: [
46-
{ ok: false, key: 'agent1-key', cert: 'agent1-cert' },
47-
{ ok: false, key: 'agent2-key', cert: 'agent2-cert' },
48-
{ ok: false, key: 'agent3-key', cert: 'agent3-cert' }
49-
]
50-
},
51-
52-
{ ca: ['ca1-cert', 'ca2-cert'],
53-
key: 'agent2-key',
54-
cert: 'agent2-cert',
55-
servers: [
56-
{ ok: true, key: 'agent1-key', cert: 'agent1-cert' },
57-
{ ok: false, key: 'agent2-key', cert: 'agent2-cert' },
58-
{ ok: true, key: 'agent3-key', cert: 'agent3-cert' }
59-
]
60-
}
61-
];
42+
{ ca: [],
43+
key: 'agent2-key',
44+
cert: 'agent2-cert',
45+
servers: [
46+
{ ok: false, key: 'agent1-key', cert: 'agent1-cert' },
47+
{ ok: false, key: 'agent2-key', cert: 'agent2-cert' },
48+
{ ok: false, key: 'agent3-key', cert: 'agent3-cert' }
49+
]
50+
},
51+
52+
{ ca: ['ca1-cert', 'ca2-cert'],
53+
key: 'agent2-key',
54+
cert: 'agent2-cert',
55+
servers: [
56+
{ ok: true, key: 'agent1-key', cert: 'agent1-cert' },
57+
{ ok: false, key: 'agent2-key', cert: 'agent2-cert' },
58+
{ ok: true, key: 'agent3-key', cert: 'agent3-cert' }
59+
]
60+
}
61+
];
6262

6363

6464
function loadPEM(n) {

0 commit comments

Comments
 (0)