Skip to content

Commit

Permalink
test: apply eslint exceptions narrowly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott committed Nov 17, 2017
1 parent d6ac8a4 commit 60698c2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ const JSStream = process.binding('js_stream').JSStream;
const util = require('util');
const vm = require('vm');

/* eslint-disable accessor-pairs */

assert.strictEqual(util.inspect(1), '1');
assert.strictEqual(util.inspect(false), 'false');
assert.strictEqual(util.inspect(''), "''");
Expand Down Expand Up @@ -280,6 +278,7 @@ assert.strictEqual(
'{ readwrite: [Getter/Setter] }');

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

Expand Down Expand Up @@ -476,7 +475,7 @@ assert.strictEqual(util.inspect(-0), '-0');
}
});
const setter = Object.create(null, {
b: {
b: { // eslint-disable-line accessor-pairs
set: function() {}
}
});
Expand Down Expand Up @@ -1151,4 +1150,3 @@ if (typeof Symbol !== 'undefined') {
}

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

0 comments on commit 60698c2

Please sign in to comment.