Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: report unused disable-directives for ESLint #25119

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ lint-md: | tools/.mdlintstamp
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools

run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
--ext=.js,.mjs,.md $(LINT_JS_TARGETS)
--report-unused-disable-directives --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
run-lint-js-fix = $(run-lint-js) --fix

.PHONY: lint-js-fix
Expand Down
1 change: 0 additions & 1 deletion test/common/wpt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/required-modules */
'use strict';

const assert = require('assert');
Expand Down
1 change: 0 additions & 1 deletion test/js-native-api/test_general/testInstanceOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const common = require('../../common');
const assert = require('assert');

// Addon is referenced through the eval expression in testFile
// eslint-disable-next-line no-unused-vars
const addon = require(`./build/${common.buildType}/test_general`);
const path = require('path');

Expand Down
1 change: 0 additions & 1 deletion test/js-native-api/test_general/testNapiRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const common = require('../../common');
const assert = require('assert');

// `addon` is referenced through the eval expression in testFile
// eslint-disable-next-line no-unused-vars
const addon = require(`./build/${common.buildType}/test_general`);

const testCase = '(41.92 + 0.08);';
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert-deep.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function re(literals, ...values) {
// That is why we discourage using deepEqual in our own tests.

// Turn off no-restricted-properties because we are testing deepEqual!
/* eslint-disable no-restricted-properties, prefer-common-expectserror */
/* eslint-disable no-restricted-properties */

const arr = new Uint8Array([120, 121, 122, 10]);
const buf = Buffer.from(arr);
Expand Down
3 changes: 0 additions & 3 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

'use strict';

/* eslint-disable node-core/prefer-common-expectserror */

const common = require('../common');
const assert = require('assert');
const { inspect } = require('util');
Expand Down Expand Up @@ -664,7 +662,6 @@ common.expectsError(
const tmp = fs.close;
fs.close = common.mustCall(tmp, 1);
function throwErr() {
// eslint-disable-next-line prefer-assert-methods
assert(
(Buffer.from('test') instanceof Error)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

/* eslint-disable max-len */
'use strict';
require('../common');
const assert = require('assert');
Expand Down
2 changes: 1 addition & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ if defined lint_js_ci goto lint-js-ci
if not defined lint_js goto lint-md-build
if not exist tools\node_modules\eslint goto no-lint
echo running lint-js
%config%\node tools\node_modules\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools
%config%\node tools\node_modules\eslint\bin\eslint.js --cache --report-unused-disable-directives --rule "linebreak-style: 0" --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools
goto lint-md-build

:lint-js-ci
Expand Down