Skip to content

Commit 60698c2

Browse files
committed
test: apply eslint exceptions narrowly
In test-util-inspect, apply ESLint exception for accessor-pairs rule narrowly. It had been applied to nearly the whole file, but is only needed for two lines. PR-URL: #16393 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent d6ac8a4 commit 60698c2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/parallel/test-util-inspect.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ const JSStream = process.binding('js_stream').JSStream;
2626
const util = require('util');
2727
const vm = require('vm');
2828

29-
/* eslint-disable accessor-pairs */
30-
3129
assert.strictEqual(util.inspect(1), '1');
3230
assert.strictEqual(util.inspect(false), 'false');
3331
assert.strictEqual(util.inspect(''), "''");
@@ -280,6 +278,7 @@ assert.strictEqual(
280278
'{ readwrite: [Getter/Setter] }');
281279

282280
assert.strictEqual(
281+
// eslint-disable-next-line accessor-pairs
283282
util.inspect({ set writeonly(val) {} }),
284283
'{ writeonly: [Setter] }');
285284

@@ -476,7 +475,7 @@ assert.strictEqual(util.inspect(-0), '-0');
476475
}
477476
});
478477
const setter = Object.create(null, {
479-
b: {
478+
b: { // eslint-disable-line accessor-pairs
480479
set: function() {}
481480
}
482481
});
@@ -1151,4 +1150,3 @@ if (typeof Symbol !== 'undefined') {
11511150
}
11521151

11531152
assert.doesNotThrow(() => util.inspect(process));
1154-
/* eslint-enable accessor-pairs */

0 commit comments

Comments
 (0)