From ec5757d2e9dfe12dfdfe73d9ade8e509301ccd18 Mon Sep 17 00:00:00 2001 From: Sri Harsha <12621691+harsha509@users.noreply.github.com> Date: Tue, 16 Apr 2024 01:50:58 +0530 Subject: [PATCH] [JS] Migrate eslint to latest (#13825) * [JS] Migrate eslint to latest * [JS] Update bazel targets * [JS] Update copyright * [JS] Update missing deps in bazel target * [JS] Update code format * [JS] Add eslint plugin for Node.js-specific linting rules --- .../node/selenium-webdriver/.eslintignore | 1 - .../node/selenium-webdriver/.eslintrc.js | 44 --- .../node/selenium-webdriver/BUILD.bazel | 17 +- .../node/selenium-webdriver/bidi/index.js | 1 - .../bidi/partitionDescriptor.js | 1 + .../common/seleniumManager.js | 8 +- .../node/selenium-webdriver/eslint.config.js | 107 +++++ javascript/node/selenium-webdriver/firefox.js | 4 +- .../node/selenium-webdriver/http/index.js | 12 +- javascript/node/selenium-webdriver/io/exec.js | 2 +- .../node/selenium-webdriver/io/index.js | 5 +- javascript/node/selenium-webdriver/io/zip.js | 2 +- .../lib/atoms/make-atoms-module.js | 6 +- .../node/selenium-webdriver/lib/http.js | 9 +- .../node/selenium-webdriver/lib/input.js | 1 - .../selenium-webdriver/lib/pinnedScript.js | 2 +- .../node/selenium-webdriver/lib/select.js | 10 +- .../node/selenium-webdriver/lib/test/build.js | 7 +- .../selenium-webdriver/lib/test/fileserver.js | 10 +- .../selenium-webdriver/lib/test/httpserver.js | 6 +- .../selenium-webdriver/lib/test/resources.js | 4 +- .../node/selenium-webdriver/lib/until.js | 6 +- .../node/selenium-webdriver/lib/util.js | 1 + .../node/selenium-webdriver/lib/webdriver.js | 4 +- .../node/selenium-webdriver/net/index.js | 2 +- .../node/selenium-webdriver/net/portprober.js | 2 +- .../node/selenium-webdriver/package.json | 9 +- .../node/selenium-webdriver/remote/index.js | 2 +- .../node/selenium-webdriver/remote/util.js | 4 +- .../selenium-webdriver/test/actions_test.js | 2 +- .../bidi/add_intercept_parameters_test.js | 2 +- .../test/bidi/bidi_session_test.js | 2 +- .../selenium-webdriver/test/bidi/bidi_test.js | 2 +- .../test/bidi/browser_test.js | 2 +- .../bidi/browsingcontext_inspector_test.js | 2 +- .../test/bidi/browsingcontext_test.js | 2 +- .../test/bidi/input_test.js | 2 +- .../test/bidi/local_value_test.js | 2 +- .../test/bidi/locate_nodes_test.js | 2 +- .../test/bidi/log_inspector_test.js | 2 +- .../test/bidi/network_commands_test.js | 2 +- .../test/bidi/network_test.js | 3 +- .../test/bidi/script_test.js | 2 +- .../test/bidi/setFiles_command_test.js | 4 +- .../test/bidi/storage_test.js | 2 +- .../selenium-webdriver/test/builder_test.js | 2 +- .../test/chrome/devtools_test.js | 6 +- .../test/chrome/options_test.js | 4 +- .../test/chrome/permission_test.js | 3 +- .../test/chrome/service_test.js | 2 +- .../selenium-webdriver/test/cookie_test.js | 4 +- .../selenium-webdriver/test/devtools_test.js | 2 +- .../selenium-webdriver/test/driver_factory.js | 7 +- .../test/edge/options_test.js | 4 +- .../test/edge/service_test.js | 2 +- .../test/elementAccessibleName_test.js | 2 +- .../test/elementAriaRole_test.js | 2 +- .../test/element_finding_test.js | 2 +- .../test/execute_script_test.js | 2 +- .../test/fingerprint_test.js | 2 +- .../test/firefox/addon_test.js | 2 +- .../test/firefox/contextSwitching_test.js | 2 +- .../test/firefox/full_page_screenshot_test.js | 2 +- .../test/firefox/options_test.js | 4 +- .../selenium-webdriver/test/frame_test.js | 2 +- .../selenium-webdriver/test/http/http_test.js | 10 +- .../selenium-webdriver/test/http/util_test.js | 4 +- .../test/ie/options_test.js | 2 +- .../selenium-webdriver/test/io/io_test.js | 6 +- .../selenium-webdriver/test/io/zip_test.js | 6 +- .../selenium-webdriver/test/lib/api_test.js | 2 +- .../selenium-webdriver/test/lib/by_test.js | 2 +- .../test/lib/capabilities_test.js | 4 +- .../test/lib/credentials_test.js | 2 +- .../selenium-webdriver/test/lib/error_test.js | 2 +- .../test/lib/form_submit_test.js | 2 +- .../selenium-webdriver/test/lib/http_test.js | 2 +- .../selenium-webdriver/test/lib/input_test.js | 2 +- .../test/lib/logging_test.js | 2 +- .../test/lib/promise_test.js | 2 +- .../selenium-webdriver/test/lib/testutil.js | 2 +- .../selenium-webdriver/test/lib/until_test.js | 6 +- .../lib/virtualauthenticatoroptions_test.js | 2 +- .../test/lib/webdriver_test.js | 2 +- .../selenium-webdriver/test/logging_test.js | 2 +- .../selenium-webdriver/test/net/index_test.js | 2 +- .../test/net/portprober_test.js | 4 +- .../test/page_loading_test.js | 2 +- .../selenium-webdriver/test/print_pdf_test.js | 2 +- .../selenium-webdriver/test/proxy_test.js | 4 +- .../node/selenium-webdriver/test/rect_test.js | 2 +- .../selenium-webdriver/test/remote_test.js | 4 +- .../selenium-webdriver/test/safari_test.js | 2 +- .../selenium-webdriver/test/select_test.js | 2 +- .../test/stale_element_test.js | 2 +- .../selenium-webdriver/test/upload_test.js | 4 +- .../test/virtualAuthenticator_test.js | 2 +- .../test/webComponent_test.js | 2 +- .../selenium-webdriver/test/window_test.js | 2 +- .../node/selenium-webdriver/testing/index.js | 3 +- .../selenium-webdriver/tools/init_jasmine.js | 4 +- package-lock.json | 371 ++++++++++++++---- pnpm-lock.yaml | 137 +++++-- 103 files changed, 680 insertions(+), 317 deletions(-) delete mode 100644 javascript/node/selenium-webdriver/.eslintignore delete mode 100644 javascript/node/selenium-webdriver/.eslintrc.js create mode 100644 javascript/node/selenium-webdriver/eslint.config.js diff --git a/javascript/node/selenium-webdriver/.eslintignore b/javascript/node/selenium-webdriver/.eslintignore deleted file mode 100644 index a7fb77637261d..0000000000000 --- a/javascript/node/selenium-webdriver/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -devtools/generator/ diff --git a/javascript/node/selenium-webdriver/.eslintrc.js b/javascript/node/selenium-webdriver/.eslintrc.js deleted file mode 100644 index 3f940a3f33534..0000000000000 --- a/javascript/node/selenium-webdriver/.eslintrc.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - env: { - mocha: true, - node: true, - es6: true, - }, - extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'], - parserOptions: { - ecmaVersion: 2022, - }, - ignorePatterns: ['.eslintrc.js', '.prettierrc'], - plugins: ['no-only-tests'], - rules: { - 'no-const-assign': 'error', - 'no-this-before-super': 'error', - 'no-undef': 'error', - 'no-unreachable': 'error', - 'no-unused-vars': [ - 'error', - { - varsIgnorePattern: '^_', - args: 'all', - argsIgnorePattern: '^_', - }, - ], - 'constructor-super': 'error', - 'valid-typeof': 'error', - 'no-only-tests/no-only-tests': 'error', - 'node/no-unpublished-require': 'error', - 'node/no-unsupported-features/es-syntax': 0, - 'node/no-unsupported-features/node-builtins': 0, - 'node/no-missing-import': 'error', - 'prettier/prettier': [ - 'error', - { - endOfLine: 'lf', - printWidth: 120, - semi: false, - singleQuote: true, - trailingComma: 'all', - }, - ], - }, -} diff --git a/javascript/node/selenium-webdriver/BUILD.bazel b/javascript/node/selenium-webdriver/BUILD.bazel index e331fed00b3a4..97139fba7405f 100644 --- a/javascript/node/selenium-webdriver/BUILD.bazel +++ b/javascript/node/selenium-webdriver/BUILD.bazel @@ -187,22 +187,15 @@ copy_to_bin( eslint_bin.eslint_test( name = "eslint-test", - args = [ - "--ignore-pattern", - "node_modules", - "--ignore-pattern", - "generator", - "--ext", - "js", - "lib/http.js", - "**/*.js", - ], chdir = package_name(), data = SRC_FILES + [ ":eslint-config", + ":node_modules/@eslint/js", + ":node_modules/eslint-plugin-mocha", + ":node_modules/eslint-plugin-n", ":node_modules/eslint-plugin-no-only-tests", - ":node_modules/eslint-plugin-node", ":node_modules/eslint-plugin-prettier", + ":node_modules/globals", ":node_modules/jszip", ":node_modules/mocha", ":node_modules/tmp", @@ -216,7 +209,7 @@ eslint_bin.eslint_test( copy_to_bin( name = "eslint-config", - srcs = [".eslintrc.js"], + srcs = ["eslint.config.js"], ) prettier_bin.prettier_test( diff --git a/javascript/node/selenium-webdriver/bidi/index.js b/javascript/node/selenium-webdriver/bidi/index.js index a27683ade98cb..34c73e21e26d1 100644 --- a/javascript/node/selenium-webdriver/bidi/index.js +++ b/javascript/node/selenium-webdriver/bidi/index.js @@ -15,7 +15,6 @@ // specific language governing permissions and limitations // under the License. -// eslint-disable-next-line node/no-missing-require const { EventEmitter } = require('node:events') const WebSocket = require('ws') diff --git a/javascript/node/selenium-webdriver/bidi/partitionDescriptor.js b/javascript/node/selenium-webdriver/bidi/partitionDescriptor.js index 8efd0d54ed5f9..91132b2bdc5ea 100644 --- a/javascript/node/selenium-webdriver/bidi/partitionDescriptor.js +++ b/javascript/node/selenium-webdriver/bidi/partitionDescriptor.js @@ -30,6 +30,7 @@ const Type = { * Described in https://w3c.github.io/webdriver-bidi/#command-storage-getCookies. */ class PartitionDescriptor { + /*eslint no-unused-private-class-members: "off"*/ #type /** diff --git a/javascript/node/selenium-webdriver/common/seleniumManager.js b/javascript/node/selenium-webdriver/common/seleniumManager.js index 1e4e89aa24b26..06302d3f597d1 100644 --- a/javascript/node/selenium-webdriver/common/seleniumManager.js +++ b/javascript/node/selenium-webdriver/common/seleniumManager.js @@ -21,10 +21,10 @@ * Wrapper for getting information from the Selenium Manager binaries */ -const { platform } = require('process') -const path = require('path') -const fs = require('fs') -const spawnSync = require('child_process').spawnSync +const { platform } = require('node:process') +const path = require('node:path') +const fs = require('node:fs') +const spawnSync = require('node:child_process').spawnSync const { Capability } = require('../lib/capabilities') const logging = require('../lib/logging') diff --git a/javascript/node/selenium-webdriver/eslint.config.js b/javascript/node/selenium-webdriver/eslint.config.js new file mode 100644 index 0000000000000..17a156726f42d --- /dev/null +++ b/javascript/node/selenium-webdriver/eslint.config.js @@ -0,0 +1,107 @@ +// Licensed to the Software Freedom Conservancy (SFC) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The SFC licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +const globals = require('globals') +const noOnlyTests = require('eslint-plugin-no-only-tests') +const js = require('@eslint/js') +const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended') +const mochaPlugin = require('eslint-plugin-mocha') +const nodePlugin = require('eslint-plugin-n') + +module.exports = [ + js.configs.recommended, + eslintPluginPrettierRecommended, + mochaPlugin.configs.flat.recommended, + nodePlugin.configs['flat/recommended-script'], + { + languageOptions: { + globals: { + mocha: true, + es6: true, + ...globals.node, + }, + parserOptions: { + ecmaVersion: 2022, + }, + }, + files: ['**/*.js', 'lib/http.js'], + ignores: ['node_modules/*', 'generator/*', 'devtools/generator/'], + plugins: { + 'no-only-tests': noOnlyTests, + }, + rules: { + 'no-const-assign': 'error', + 'no-this-before-super': 'error', + 'no-undef': 'error', + 'no-unreachable': 'error', + 'no-unused-vars': [ + 'error', + { + varsIgnorePattern: '^_', + args: 'all', + argsIgnorePattern: '^_', + }, + ], + 'constructor-super': 'error', + 'valid-typeof': 'error', + 'no-only-tests/no-only-tests': 'error', + 'n/no-deprecated-api': ['error'], + 'n/no-missing-import': ['error'], + 'n/no-missing-require': ['error'], + 'n/no-mixed-requires': ['error'], + 'n/no-new-require': ['error'], + 'n/no-unpublished-import': ['error'], + 'n/no-unpublished-require': [ + 'error', + { + allowModules: [ + 'globals', + '@eslint/js', + 'eslint-plugin-mocha', + 'eslint-plugin-prettier', + 'eslint-plugin-n', + 'eslint-plugin-no-only-tests', + ], + tryExtensions: ['.js'], + }, + ], + 'n/prefer-node-protocol': ['error'], + 'mocha/no-skipped-tests': ['off'], + 'mocha/no-mocha-arrows': ['off'], + 'mocha/no-setup-in-describe': ['off'], + 'mocha/no-top-level-hooks': ['off'], + 'mocha/no-sibling-hooks': ['off'], + 'mocha/no-exports': ['off'], + 'mocha/no-empty-description': ['off'], + 'mocha/max-top-level-suites': ['off'], + 'mocha/consistent-spacing-between-blocks': ['off'], + 'mocha/no-nested-tests': ['off'], + 'mocha/no-pending-tests': ['off'], + 'mocha/no-identical-title': ['off'], + 'prettier/prettier': [ + 'error', + { + endOfLine: 'lf', + printWidth: 120, + semi: false, + singleQuote: true, + trailingComma: 'all', + }, + ], + }, + }, +] diff --git a/javascript/node/selenium-webdriver/firefox.js b/javascript/node/selenium-webdriver/firefox.js index c38efd1b56d7f..5597e69681439 100644 --- a/javascript/node/selenium-webdriver/firefox.js +++ b/javascript/node/selenium-webdriver/firefox.js @@ -107,8 +107,8 @@ 'use strict' -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const Symbols = require('./lib/symbols') const command = require('./lib/command') const http = require('./http') diff --git a/javascript/node/selenium-webdriver/http/index.js b/javascript/node/selenium-webdriver/http/index.js index ab6a15df65494..676e367ed6449 100644 --- a/javascript/node/selenium-webdriver/http/index.js +++ b/javascript/node/selenium-webdriver/http/index.js @@ -22,9 +22,9 @@ 'use strict' -const http = require('http') -const https = require('https') -const url = require('url') +const http = require('node:http') +const https = require('node:https') +const url = require('node:url') const httpLib = require('../lib/http') @@ -45,7 +45,7 @@ let RequestOptions // eslint-disable-line * @throws {Error} if the URL does not include a hostname. */ function getRequestOptions(aUrl) { - //eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api let options = url.parse(aUrl) if (!options.hostname) { throw new Error('Invalid URL: ' + aUrl) @@ -140,7 +140,7 @@ class HttpClient { } else { path += httpRequest.path } - //eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api let parsedPath = url.parse(path) let options = { @@ -218,7 +218,7 @@ function sendRequest(options, onOk, onError, opt_data, opt_proxy, opt_retries) { if (response.statusCode == 302 || response.statusCode == 303) { let location try { - // eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api location = url.parse(response.headers['location']) } catch (ex) { onError( diff --git a/javascript/node/selenium-webdriver/io/exec.js b/javascript/node/selenium-webdriver/io/exec.js index 53ae448f28160..6af991a50fd80 100644 --- a/javascript/node/selenium-webdriver/io/exec.js +++ b/javascript/node/selenium-webdriver/io/exec.js @@ -17,7 +17,7 @@ 'use strict' -const childProcess = require('child_process') +const childProcess = require('node:child_process') /** * Options for configuring an executed command. diff --git a/javascript/node/selenium-webdriver/io/index.js b/javascript/node/selenium-webdriver/io/index.js index 2250ad005e755..4fa5daaace103 100644 --- a/javascript/node/selenium-webdriver/io/index.js +++ b/javascript/node/selenium-webdriver/io/index.js @@ -17,8 +17,8 @@ 'use strict' -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const tmp = require('tmp') /** @@ -219,6 +219,7 @@ function findInPath(file, opt_checkCwd) { try { let stats = fs.statSync(tmp) return stats.isFile() && !stats.isDirectory() + /*eslint no-unused-vars: "off"*/ } catch (ex) { return false } diff --git a/javascript/node/selenium-webdriver/io/zip.js b/javascript/node/selenium-webdriver/io/zip.js index a41c5489be25c..3369d46fe32d9 100644 --- a/javascript/node/selenium-webdriver/io/zip.js +++ b/javascript/node/selenium-webdriver/io/zip.js @@ -18,7 +18,7 @@ 'use strict' const jszip = require('jszip') -const path = require('path') +const path = require('node:path') const io = require('./index') const { InvalidArgumentError } = require('../lib/error') diff --git a/javascript/node/selenium-webdriver/lib/atoms/make-atoms-module.js b/javascript/node/selenium-webdriver/lib/atoms/make-atoms-module.js index 377511d95853e..89693c0d68914 100644 --- a/javascript/node/selenium-webdriver/lib/atoms/make-atoms-module.js +++ b/javascript/node/selenium-webdriver/lib/atoms/make-atoms-module.js @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') if (process.argv.length < 3) { process.stderr.write(`Usage: node ${path.basename(__filename)} \n`) - // eslint-disable-next-line no-process-exit + // eslint-disable-next-line n/no-process-exit process.exit(-1) } diff --git a/javascript/node/selenium-webdriver/lib/http.js b/javascript/node/selenium-webdriver/lib/http.js index 7365ea4bf1995..eea7a4fe58d9f 100644 --- a/javascript/node/selenium-webdriver/lib/http.js +++ b/javascript/node/selenium-webdriver/lib/http.js @@ -25,7 +25,7 @@ 'use strict' -const path = require('path') +const path = require('node:path') const cmd = require('./command') const error = require('./error') const logging = require('./logging') @@ -161,10 +161,10 @@ function resource(method, path) { } /** @typedef {{method: string, path: string}} */ -var CommandSpec // eslint-disable-line +var CommandSpec /** @typedef {function(!cmd.Command): !cmd.Command} */ -var CommandTransformer // eslint-disable-line +var CommandTransformer class InternalTypeError extends TypeError {} @@ -337,7 +337,7 @@ class Client { * @return {!Promise} A promise that will be fulfilled with the * server's response. */ - send(httpRequest) {} // eslint-disable-line + send(httpRequest) {} } /** @@ -472,6 +472,7 @@ class Executor { function tryParse(str) { try { return JSON.parse(str) + /*eslint no-unused-vars: "off"*/ } catch (ignored) { // Do nothing. } diff --git a/javascript/node/selenium-webdriver/lib/input.js b/javascript/node/selenium-webdriver/lib/input.js index bed5d990dc7fa..8642c5209bce0 100644 --- a/javascript/node/selenium-webdriver/lib/input.js +++ b/javascript/node/selenium-webdriver/lib/input.js @@ -162,7 +162,6 @@ class FileDetector { * @package */ handleFile(_driver, path) { - // eslint-disable-line return Promise.resolve(path) } } diff --git a/javascript/node/selenium-webdriver/lib/pinnedScript.js b/javascript/node/selenium-webdriver/lib/pinnedScript.js index a3f4542e651a7..4a9c87442c718 100644 --- a/javascript/node/selenium-webdriver/lib/pinnedScript.js +++ b/javascript/node/selenium-webdriver/lib/pinnedScript.js @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -const crypto = require('crypto') +const crypto = require('node:crypto') class PinnedScript { constructor(script) { diff --git a/javascript/node/selenium-webdriver/lib/select.js b/javascript/node/selenium-webdriver/lib/select.js index 6d24a3bd64063..a0d8bd7976766 100644 --- a/javascript/node/selenium-webdriver/lib/select.js +++ b/javascript/node/selenium-webdriver/lib/select.js @@ -51,23 +51,23 @@ class ISelect { * @return {!Promise} Whether this select element supports selecting multiple options at the same time? This * is done by checking the value of the "multiple" attribute. */ - isMultiple() {} // eslint-disable-line + isMultiple() {} /** * @return {!Promise>} All options belonging to this select tag */ - getOptions() {} // eslint-disable-line + getOptions() {} /** * @return {!Promise>} All selected options belonging to this select tag */ - getAllSelectedOptions() {} // eslint-disable-line + getAllSelectedOptions() {} /** * @return {!Promise} The first selected option in this select tag (or the currently selected option in a * normal select) */ - getFirstSelectedOption() {} // eslint-disable-line + getFirstSelectedOption() {} /** * Select all options that display text matching the argument. That is, when given "Bar" this @@ -105,7 +105,7 @@ class ISelect { * * @return {Promise} */ - deselectAll() {} // eslint-disable-line + deselectAll() {} /** * Deselect all options that display text matching the argument. That is, when given "Bar" this diff --git a/javascript/node/selenium-webdriver/lib/test/build.js b/javascript/node/selenium-webdriver/lib/test/build.js index b70991f086cf2..82dc07235de87 100644 --- a/javascript/node/selenium-webdriver/lib/test/build.js +++ b/javascript/node/selenium-webdriver/lib/test/build.js @@ -17,9 +17,9 @@ 'use strict' -const fs = require('fs') -const path = require('path') -const { spawn } = require('child_process') +const fs = require('node:fs') +const path = require('node:path') +const { spawn } = require('node:child_process') const PROJECT_ROOT = path.normalize(path.join(__dirname, '../../../../..')) const WORKSPACE_FILE = path.join(PROJECT_ROOT, 'WORKSPACE') @@ -134,7 +134,6 @@ exports.isDevMode = isDevMode * @throws {Error} If not running in dev mode. */ exports.of = function (_) { - // eslint-disable-line let targets = Array.prototype.slice.call(arguments, 0) return new Build(targets) } diff --git a/javascript/node/selenium-webdriver/lib/test/fileserver.js b/javascript/node/selenium-webdriver/lib/test/fileserver.js index 73137c1fd6a5c..aa270d54f91d8 100644 --- a/javascript/node/selenium-webdriver/lib/test/fileserver.js +++ b/javascript/node/selenium-webdriver/lib/test/fileserver.js @@ -17,8 +17,8 @@ 'use strict' -const path = require('path') -const url = require('url') +const path = require('node:path') +const url = require('node:url') const express = require('express') const multer = require('multer') @@ -165,7 +165,7 @@ function redirectToResultPage(_, response) { } function sendInifinitePage(request, response) { - // eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api var pathname = url.parse(request.url).pathname var lastIndex = pathname.lastIndexOf('/') var pageNumber = lastIndex == -1 ? 'Unknown' : pathname.substring(lastIndex + 1) @@ -213,7 +213,7 @@ function sendBasicAuth(request, response) { function sendDelayedResponse(request, response) { var duration = 0 - // eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api var query = url.parse(request.url).search.substr(1) || '' var match = query.match(/\btime=(\d+)/) if (match) { @@ -301,7 +301,7 @@ function sendEcho(request, response) { * @param {!http.ServerResponse} response The response object. */ function sendIndex(request, response) { - // eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api var pathname = url.parse(request.url).pathname var host = request.headers.host diff --git a/javascript/node/selenium-webdriver/lib/test/httpserver.js b/javascript/node/selenium-webdriver/lib/test/httpserver.js index 5f432314f1219..b9053ca7584a0 100644 --- a/javascript/node/selenium-webdriver/lib/test/httpserver.js +++ b/javascript/node/selenium-webdriver/lib/test/httpserver.js @@ -17,9 +17,9 @@ 'use strict' -const assert = require('assert') -const http = require('http') -const url = require('url') +const assert = require('node:assert') +const http = require('node:http') +const url = require('node:url') const net = require('../../net') const portprober = require('../../net/portprober') diff --git a/javascript/node/selenium-webdriver/lib/test/resources.js b/javascript/node/selenium-webdriver/lib/test/resources.js index 553aee00261af..a45f3ae0ac3b7 100644 --- a/javascript/node/selenium-webdriver/lib/test/resources.js +++ b/javascript/node/selenium-webdriver/lib/test/resources.js @@ -17,8 +17,8 @@ 'use strict' -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const { projectRoot } = require('./build') // PUBLIC API diff --git a/javascript/node/selenium-webdriver/lib/until.js b/javascript/node/selenium-webdriver/lib/until.js index 4286579221a7a..d2777cc6adec9 100644 --- a/javascript/node/selenium-webdriver/lib/until.js +++ b/javascript/node/selenium-webdriver/lib/until.js @@ -43,9 +43,9 @@ const by = require('./by') const error = require('./error') -const webdriver = require('./webdriver'), - Condition = webdriver.Condition, - WebElementCondition = webdriver.WebElementCondition +const webdriver = require('./webdriver') +const Condition = webdriver.Condition +const WebElementCondition = webdriver.WebElementCondition /** * Creates a condition that will wait until the input driver is able to switch diff --git a/javascript/node/selenium-webdriver/lib/util.js b/javascript/node/selenium-webdriver/lib/util.js index 3723b34d3f680..d16e77ecb1a3e 100644 --- a/javascript/node/selenium-webdriver/lib/util.js +++ b/javascript/node/selenium-webdriver/lib/util.js @@ -38,6 +38,7 @@ function isPromise(value) { // Use array notation so the Closure compiler does not obfuscate away our // contract. return (typeof value === 'object' || typeof value === 'function') && typeof value['then'] === 'function' + /*eslint no-unused-vars: "off"*/ } catch (ex) { return false } diff --git a/javascript/node/selenium-webdriver/lib/webdriver.js b/javascript/node/selenium-webdriver/lib/webdriver.js index 9489f9543b711..012e02a0db7f4 100644 --- a/javascript/node/selenium-webdriver/lib/webdriver.js +++ b/javascript/node/selenium-webdriver/lib/webdriver.js @@ -32,9 +32,9 @@ const Symbols = require('./symbols') const cdp = require('../devtools/CDPConnection') const WebSocket = require('ws') const http = require('../http/index') -const fs = require('fs') +const fs = require('node:fs') const { Capabilities } = require('./capabilities') -const path = require('path') +const path = require('node:path') const { NoSuchElementError } = require('./error') const cdpTargets = ['page', 'browser'] const { Credential } = require('./virtual_authenticator') diff --git a/javascript/node/selenium-webdriver/net/index.js b/javascript/node/selenium-webdriver/net/index.js index f87119bcb6ace..dbb46951be1a3 100644 --- a/javascript/node/selenium-webdriver/net/index.js +++ b/javascript/node/selenium-webdriver/net/index.js @@ -17,7 +17,7 @@ 'use strict' -const os = require('os') +const os = require('node:os') function getLoInterface() { let name diff --git a/javascript/node/selenium-webdriver/net/portprober.js b/javascript/node/selenium-webdriver/net/portprober.js index 4765445162076..700bf8f725d10 100644 --- a/javascript/node/selenium-webdriver/net/portprober.js +++ b/javascript/node/selenium-webdriver/net/portprober.js @@ -17,7 +17,7 @@ 'use strict' -const net = require('net') +const net = require('node:net') /** * Tests if a port is free. diff --git a/javascript/node/selenium-webdriver/package.json b/javascript/node/selenium-webdriver/package.json index c7c3aa9bf037c..ced55c0bb5e24 100644 --- a/javascript/node/selenium-webdriver/package.json +++ b/javascript/node/selenium-webdriver/package.json @@ -29,12 +29,15 @@ }, "devDependencies": { "@bazel/runfiles": "^5.8.1", + "@eslint/js": "^9.0.0", "eslint": "^9.0.0", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-mocha": "^10.4.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-no-only-tests": "^3.1.0", - "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^5.1.3", "express": "^4.19.2", + "globals": "^15.0.0", "mocha": "^10.4.0", "mocha-junit-reporter": "^2.2.1", "multer": "^1.4.5-lts.1", @@ -43,8 +46,8 @@ "sinon": "^17.0.1" }, "scripts": { - "lint": "eslint --ignore-pattern node_modules --ignore-pattern generator --ext js lib/http.js \"**/*.js\"", - "lint:fix": "eslint --ignore-pattern node_modules --ignore-pattern generator --ext js lib/http.js \"**/*.js\" --fix", + "lint": "eslint .", + "lint:fix": "eslint . --fix", "test": "npm run lint && mocha -t 600000 --recursive test", "test-jasmine": "bazel test //javascript/node/selenium-webdriver:tests" }, diff --git a/javascript/node/selenium-webdriver/remote/index.js b/javascript/node/selenium-webdriver/remote/index.js index 576b77f9cb5f8..bc3e4e3255696 100644 --- a/javascript/node/selenium-webdriver/remote/index.js +++ b/javascript/node/selenium-webdriver/remote/index.js @@ -17,7 +17,7 @@ 'use strict' -const url = require('url') +const url = require('node:url') const httpUtil = require('../http/util') const io = require('../io') diff --git a/javascript/node/selenium-webdriver/remote/util.js b/javascript/node/selenium-webdriver/remote/util.js index 0a72c680fa021..376b67bbf0dc8 100644 --- a/javascript/node/selenium-webdriver/remote/util.js +++ b/javascript/node/selenium-webdriver/remote/util.js @@ -17,8 +17,8 @@ 'use strict' -const path = require('path') -const cp = require('child_process') +const path = require('node:path') +const cp = require('node:child_process') const logging = require('../lib/logging') /** diff --git a/javascript/node/selenium-webdriver/test/actions_test.js b/javascript/node/selenium-webdriver/test/actions_test.js index 6ebd48f9e862c..d069445e299da 100644 --- a/javascript/node/selenium-webdriver/test/actions_test.js +++ b/javascript/node/selenium-webdriver/test/actions_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const fileServer = require('../lib/test/fileserver') const { ignore, Pages, suite } = require('../lib/test') const { Key, Origin } = require('../lib/input') diff --git a/javascript/node/selenium-webdriver/test/bidi/add_intercept_parameters_test.js b/javascript/node/selenium-webdriver/test/bidi/add_intercept_parameters_test.js index c032c827e1e14..16c28212c5aff 100644 --- a/javascript/node/selenium-webdriver/test/bidi/add_intercept_parameters_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/add_intercept_parameters_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { suite } = require('../../lib/test') const Network = require('../../bidi/network') diff --git a/javascript/node/selenium-webdriver/test/bidi/bidi_session_test.js b/javascript/node/selenium-webdriver/test/bidi/bidi_session_test.js index dab88285c33d0..d187df4d6c26a 100644 --- a/javascript/node/selenium-webdriver/test/bidi/bidi_session_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/bidi_session_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { suite } = require('../../lib/test') diff --git a/javascript/node/selenium-webdriver/test/bidi/bidi_test.js b/javascript/node/selenium-webdriver/test/bidi/bidi_test.js index e4e158b497f20..c448230282655 100644 --- a/javascript/node/selenium-webdriver/test/bidi/bidi_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/bidi_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { Pages, suite } = require('../../lib/test') const logInspector = require('../../bidi/logInspector') diff --git a/javascript/node/selenium-webdriver/test/bidi/browser_test.js b/javascript/node/selenium-webdriver/test/bidi/browser_test.js index 5b2cb9f345fdf..45d079d806225 100644 --- a/javascript/node/selenium-webdriver/test/bidi/browser_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/browser_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { suite } = require('../../lib/test') const { Browser } = require('../..') const BrowserBiDi = require('../../bidi/browser') diff --git a/javascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js b/javascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js index b6be32635e42e..76d315942bf1c 100644 --- a/javascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser, By } = require('../../') const { Pages, suite, ignore } = require('../../lib/test') const BrowsingContext = require('../../bidi/browsingContext') diff --git a/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js b/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js index 97e147459776c..6bc77d55d5d6f 100644 --- a/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser, By } = require('../../') const { Pages, suite, ignore } = require('../../lib/test') const BrowsingContext = require('../../bidi/browsingContext') diff --git a/javascript/node/selenium-webdriver/test/bidi/input_test.js b/javascript/node/selenium-webdriver/test/bidi/input_test.js index 75c88f160668b..58a4a3ca44586 100644 --- a/javascript/node/selenium-webdriver/test/bidi/input_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/input_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const fileServer = require('../../lib/test/fileserver') const { ignore, Pages, suite } = require('../../lib/test') const { Key, Origin } = require('../../lib/input') diff --git a/javascript/node/selenium-webdriver/test/bidi/local_value_test.js b/javascript/node/selenium-webdriver/test/bidi/local_value_test.js index e3d4fcfeea3cf..8ae42d46756eb 100644 --- a/javascript/node/selenium-webdriver/test/bidi/local_value_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/local_value_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { suite } = require('../../lib/test') diff --git a/javascript/node/selenium-webdriver/test/bidi/locate_nodes_test.js b/javascript/node/selenium-webdriver/test/bidi/locate_nodes_test.js index c0e7a8a7aada8..737bf862952ca 100644 --- a/javascript/node/selenium-webdriver/test/bidi/locate_nodes_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/locate_nodes_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const firefox = require('../../firefox') const { Browser } = require('../../') const { Pages, suite } = require('../../lib/test') diff --git a/javascript/node/selenium-webdriver/test/bidi/log_inspector_test.js b/javascript/node/selenium-webdriver/test/bidi/log_inspector_test.js index 54ad249408b09..601291fd16619 100644 --- a/javascript/node/selenium-webdriver/test/bidi/log_inspector_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/log_inspector_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { Pages, suite } = require('../../lib/test') const logInspector = require('../../bidi/logInspector') diff --git a/javascript/node/selenium-webdriver/test/bidi/network_commands_test.js b/javascript/node/selenium-webdriver/test/bidi/network_commands_test.js index a8a389bf259c3..0652226559b63 100644 --- a/javascript/node/selenium-webdriver/test/bidi/network_commands_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/network_commands_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser, By } = require('../../') const { Pages, suite } = require('../../lib/test') const Network = require('../../bidi/network') diff --git a/javascript/node/selenium-webdriver/test/bidi/network_test.js b/javascript/node/selenium-webdriver/test/bidi/network_test.js index b2edfd778698c..f5248cc8b1f9a 100644 --- a/javascript/node/selenium-webdriver/test/bidi/network_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/network_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { Pages, suite, ignore } = require('../../lib/test') const Network = require('../../bidi/network') @@ -182,6 +182,7 @@ suite( try { await driver.get('https://not_a_valid_url.test/') + /*eslint no-unused-vars: "off"*/ } catch (e) { // ignore } diff --git a/javascript/node/selenium-webdriver/test/bidi/script_test.js b/javascript/node/selenium-webdriver/test/bidi/script_test.js index a3ec2104c2356..e5bcdcebf7ab0 100644 --- a/javascript/node/selenium-webdriver/test/bidi/script_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/script_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../') const { Pages, suite } = require('../../lib/test') const BrowsingContext = require('../../bidi/browsingContext') diff --git a/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js b/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js index 63f3cef74f04d..01bf75b0b4b2e 100644 --- a/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js @@ -17,14 +17,14 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') require('../../lib/test/fileserver') const { Pages, suite } = require('../../lib/test') const { Browser, By } = require('../..') const Input = require('../../bidi/input') const io = require('../../io') const { ReferenceValue, RemoteReferenceType } = require('../../bidi/protocolValue') -const fs = require('fs') +const fs = require('node:fs') const { ignore } = require('../../testing') suite( diff --git a/javascript/node/selenium-webdriver/test/bidi/storage_test.js b/javascript/node/selenium-webdriver/test/bidi/storage_test.js index 358981563a616..25202eb1838c5 100644 --- a/javascript/node/selenium-webdriver/test/bidi/storage_test.js +++ b/javascript/node/selenium-webdriver/test/bidi/storage_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') require('../../lib/test/fileserver') const { suite } = require('../../lib/test') const { Browser } = require('../..') diff --git a/javascript/node/selenium-webdriver/test/builder_test.js b/javascript/node/selenium-webdriver/test/builder_test.js index 2b71d7ab01d61..545966e237c10 100644 --- a/javascript/node/selenium-webdriver/test/builder_test.js +++ b/javascript/node/selenium-webdriver/test/builder_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const chrome = require('../chrome') const edge = require('../edge') diff --git a/javascript/node/selenium-webdriver/test/chrome/devtools_test.js b/javascript/node/selenium-webdriver/test/chrome/devtools_test.js index 184307694fd45..df940850d7723 100644 --- a/javascript/node/selenium-webdriver/test/chrome/devtools_test.js +++ b/javascript/node/selenium-webdriver/test/chrome/devtools_test.js @@ -17,9 +17,9 @@ 'use strict' -const assert = require('assert') -const fs = require('fs') -const path = require('path') +const assert = require('node:assert') +const fs = require('node:fs') +const path = require('node:path') const chrome = require('../../chrome') const by = require('../../lib/by') diff --git a/javascript/node/selenium-webdriver/test/chrome/options_test.js b/javascript/node/selenium-webdriver/test/chrome/options_test.js index 0b42b0303892c..9570d06cbf1f3 100644 --- a/javascript/node/selenium-webdriver/test/chrome/options_test.js +++ b/javascript/node/selenium-webdriver/test/chrome/options_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const fs = require('fs') +const assert = require('node:assert') +const fs = require('node:fs') const chrome = require('../../chrome') const symbols = require('../../lib/symbols') const test = require('../../lib/test') diff --git a/javascript/node/selenium-webdriver/test/chrome/permission_test.js b/javascript/node/selenium-webdriver/test/chrome/permission_test.js index 8f1dfe956bd4c..0ff4ae2d509b5 100644 --- a/javascript/node/selenium-webdriver/test/chrome/permission_test.js +++ b/javascript/node/selenium-webdriver/test/chrome/permission_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const chrome = require('../../chrome') const test = require('../../lib/test') const { ignore } = require('../../lib/test') @@ -61,7 +61,6 @@ test.suite( const checkPermission = (driver, permission) => { return driver.executeAsyncScript((permission, callback) => { - // eslint-disable-next-line no-undef navigator.permissions.query({ name: permission }).then((result) => callback(result.state)) }, permission) } diff --git a/javascript/node/selenium-webdriver/test/chrome/service_test.js b/javascript/node/selenium-webdriver/test/chrome/service_test.js index 51dde968bdca2..f992af6b25149 100644 --- a/javascript/node/selenium-webdriver/test/chrome/service_test.js +++ b/javascript/node/selenium-webdriver/test/chrome/service_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const chrome = require('../../chrome') const test = require('../../lib/test') const { getPath } = require('../../common/driverFinder') diff --git a/javascript/node/selenium-webdriver/test/cookie_test.js b/javascript/node/selenium-webdriver/test/cookie_test.js index 82a831af6e453..c63b11f0e5f89 100644 --- a/javascript/node/selenium-webdriver/test/cookie_test.js +++ b/javascript/node/selenium-webdriver/test/cookie_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const { URL } = require('url') +const assert = require('node:assert') +const { URL } = require('node:url') const { ignore, suite } = require('../lib/test') const fileserver = require('../lib/test/fileserver') diff --git a/javascript/node/selenium-webdriver/test/devtools_test.js b/javascript/node/selenium-webdriver/test/devtools_test.js index fe34c026ca8b6..204ccb8624c09 100644 --- a/javascript/node/selenium-webdriver/test/devtools_test.js +++ b/javascript/node/selenium-webdriver/test/devtools_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser, until } = require('..') const fileServer = require('../lib/test/fileserver') const { HttpResponse } = require('../devtools/networkinterceptor') diff --git a/javascript/node/selenium-webdriver/test/driver_factory.js b/javascript/node/selenium-webdriver/test/driver_factory.js index 32e2d2ea9c8da..14c3d606a7a9c 100644 --- a/javascript/node/selenium-webdriver/test/driver_factory.js +++ b/javascript/node/selenium-webdriver/test/driver_factory.js @@ -16,14 +16,13 @@ // under the License. 'use strict' -const fs = require('fs') -const os = require('os') -const path = require('path') +const fs = require('node:fs') +const os = require('node:os') +const path = require('node:path') const { Browser } = require('../index') const { Environment } = require('../testing') const chrome = require('../chrome') const firefox = require('../firefox') -// eslint-disable-next-line node/no-missing-require const { runfiles } = require('@bazel/runfiles') function GetBrowserForTests() { diff --git a/javascript/node/selenium-webdriver/test/edge/options_test.js b/javascript/node/selenium-webdriver/test/edge/options_test.js index 316938c941ad7..e20deca669396 100644 --- a/javascript/node/selenium-webdriver/test/edge/options_test.js +++ b/javascript/node/selenium-webdriver/test/edge/options_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const fs = require('fs') +const assert = require('node:assert') +const fs = require('node:fs') const edge = require('../../edge') const symbols = require('../../lib/symbols') const test = require('../../lib/test') diff --git a/javascript/node/selenium-webdriver/test/edge/service_test.js b/javascript/node/selenium-webdriver/test/edge/service_test.js index 285d73fafb920..73d8ecfeb7f12 100644 --- a/javascript/node/selenium-webdriver/test/edge/service_test.js +++ b/javascript/node/selenium-webdriver/test/edge/service_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const edge = require('../../edge') const test = require('../../lib/test') const { getPath } = require('../../common/driverFinder') diff --git a/javascript/node/selenium-webdriver/test/elementAccessibleName_test.js b/javascript/node/selenium-webdriver/test/elementAccessibleName_test.js index aa18252a39f63..bb9b7e88e8f11 100644 --- a/javascript/node/selenium-webdriver/test/elementAccessibleName_test.js +++ b/javascript/node/selenium-webdriver/test/elementAccessibleName_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const { By, Browser } = require('../index') const { ignore } = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/elementAriaRole_test.js b/javascript/node/selenium-webdriver/test/elementAriaRole_test.js index 6ba24354533ce..ecc4eac3de287 100644 --- a/javascript/node/selenium-webdriver/test/elementAriaRole_test.js +++ b/javascript/node/selenium-webdriver/test/elementAriaRole_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const { By } = require('../index') diff --git a/javascript/node/selenium-webdriver/test/element_finding_test.js b/javascript/node/selenium-webdriver/test/element_finding_test.js index 5eb4db6d9a706..5961ac8dc1ecc 100644 --- a/javascript/node/selenium-webdriver/test/element_finding_test.js +++ b/javascript/node/selenium-webdriver/test/element_finding_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const promise = require('../lib/promise') const { Browser, By, error, withTagName, until } = require('..') const { Pages, ignore, suite, whereIs } = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/execute_script_test.js b/javascript/node/selenium-webdriver/test/execute_script_test.js index 16af3a4029616..7cc7acc9a2c21 100644 --- a/javascript/node/selenium-webdriver/test/execute_script_test.js +++ b/javascript/node/selenium-webdriver/test/execute_script_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser, By, WebElement, error } = require('..') const { Pages, ignore, suite } = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/fingerprint_test.js b/javascript/node/selenium-webdriver/test/fingerprint_test.js index b5df57647d8a5..79e6613cab0a2 100644 --- a/javascript/node/selenium-webdriver/test/fingerprint_test.js +++ b/javascript/node/selenium-webdriver/test/fingerprint_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const Pages = test.Pages diff --git a/javascript/node/selenium-webdriver/test/firefox/addon_test.js b/javascript/node/selenium-webdriver/test/firefox/addon_test.js index c4f8cad268c1a..236e0ca38738d 100644 --- a/javascript/node/selenium-webdriver/test/firefox/addon_test.js +++ b/javascript/node/selenium-webdriver/test/firefox/addon_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../index') const { Pages, suite } = require('../../lib/test') const { locate } = require('../../lib/test/resources') diff --git a/javascript/node/selenium-webdriver/test/firefox/contextSwitching_test.js b/javascript/node/selenium-webdriver/test/firefox/contextSwitching_test.js index 3d54e15d65bdc..d95d9172a6bf7 100644 --- a/javascript/node/selenium-webdriver/test/firefox/contextSwitching_test.js +++ b/javascript/node/selenium-webdriver/test/firefox/contextSwitching_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const error = require('../../lib/error') const { Browser } = require('../../index') const { Context } = require('../../firefox') diff --git a/javascript/node/selenium-webdriver/test/firefox/full_page_screenshot_test.js b/javascript/node/selenium-webdriver/test/firefox/full_page_screenshot_test.js index 9614f3f95c671..d80509a5df058 100644 --- a/javascript/node/selenium-webdriver/test/firefox/full_page_screenshot_test.js +++ b/javascript/node/selenium-webdriver/test/firefox/full_page_screenshot_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Browser } = require('../../index') const { Pages, suite } = require('../../lib/test') let startIndex = 0 diff --git a/javascript/node/selenium-webdriver/test/firefox/options_test.js b/javascript/node/selenium-webdriver/test/firefox/options_test.js index a3e16ac87995f..50f8441a05373 100644 --- a/javascript/node/selenium-webdriver/test/firefox/options_test.js +++ b/javascript/node/selenium-webdriver/test/firefox/options_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const path = require('path') +const assert = require('node:assert') +const path = require('node:path') const firefox = require('../../firefox') const io = require('../../io') const { Browser } = require('../../index') diff --git a/javascript/node/selenium-webdriver/test/frame_test.js b/javascript/node/selenium-webdriver/test/frame_test.js index adafc969d5316..56fff545c901e 100644 --- a/javascript/node/selenium-webdriver/test/frame_test.js +++ b/javascript/node/selenium-webdriver/test/frame_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const { By } = require('..') diff --git a/javascript/node/selenium-webdriver/test/http/http_test.js b/javascript/node/selenium-webdriver/test/http/http_test.js index 99197a3d1c7e8..a2d35871abfce 100644 --- a/javascript/node/selenium-webdriver/test/http/http_test.js +++ b/javascript/node/selenium-webdriver/test/http/http_test.js @@ -17,9 +17,9 @@ 'use strict' -const assert = require('assert') -const http = require('http') -const url = require('url') +const assert = require('node:assert') +const http = require('node:http') +const url = require('node:url') const HttpClient = require('../../http').HttpClient const HttpRequest = require('../../lib/http').Request @@ -27,7 +27,7 @@ const Server = require('../../lib/test/httpserver').Server describe('HttpClient', function () { const server = new Server(function (req, res) { - // eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api const parsedUrl = url.parse(req.url) if (req.method === 'GET' && req.url === '/echo') { @@ -186,7 +186,7 @@ describe('HttpClient', function () { }) it('can use basic auth', function () { - // eslint-disable-next-line node/no-deprecated-api + // eslint-disable-next-line n/no-deprecated-api const parsed = url.parse(server.url()) parsed.auth = 'genie:bottle' diff --git a/javascript/node/selenium-webdriver/test/http/util_test.js b/javascript/node/selenium-webdriver/test/http/util_test.js index 95479032e6371..b6cad07a3003c 100644 --- a/javascript/node/selenium-webdriver/test/http/util_test.js +++ b/javascript/node/selenium-webdriver/test/http/util_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const http = require('http') +const assert = require('node:assert') +const http = require('node:http') const error = require('../../lib/error') const util = require('../../http/util') diff --git a/javascript/node/selenium-webdriver/test/ie/options_test.js b/javascript/node/selenium-webdriver/test/ie/options_test.js index c5c818d22c9c8..eefcb6102afb5 100644 --- a/javascript/node/selenium-webdriver/test/ie/options_test.js +++ b/javascript/node/selenium-webdriver/test/ie/options_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const ie = require('../../ie') const test = require('../../lib/test') const Capabilities = require('../../lib/capabilities').Capabilities diff --git a/javascript/node/selenium-webdriver/test/io/io_test.js b/javascript/node/selenium-webdriver/test/io/io_test.js index 760e50bfa56b4..4b0f18d34550f 100644 --- a/javascript/node/selenium-webdriver/test/io/io_test.js +++ b/javascript/node/selenium-webdriver/test/io/io_test.js @@ -17,9 +17,9 @@ 'use strict' -const assert = require('assert'), - fs = require('fs'), - path = require('path') +const assert = require('node:assert'), + fs = require('node:fs'), + path = require('node:path') const io = require('../../io') diff --git a/javascript/node/selenium-webdriver/test/io/zip_test.js b/javascript/node/selenium-webdriver/test/io/zip_test.js index 4373db0d8daa4..5ba71e470c1b9 100644 --- a/javascript/node/selenium-webdriver/test/io/zip_test.js +++ b/javascript/node/selenium-webdriver/test/io/zip_test.js @@ -17,9 +17,9 @@ 'use strict' -const assert = require('assert') -const fs = require('fs') -const path = require('path') +const assert = require('node:assert') +const fs = require('node:fs') +const path = require('node:path') const io = require('../../io') const zip = require('../../io/zip') diff --git a/javascript/node/selenium-webdriver/test/lib/api_test.js b/javascript/node/selenium-webdriver/test/lib/api_test.js index 37d3228400f9f..986f403ae2840 100644 --- a/javascript/node/selenium-webdriver/test/lib/api_test.js +++ b/javascript/node/selenium-webdriver/test/lib/api_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { By, Browser } = require('../../index') const { Pages, ignore, suite } = require('../../lib/test') diff --git a/javascript/node/selenium-webdriver/test/lib/by_test.js b/javascript/node/selenium-webdriver/test/lib/by_test.js index 077e72a6a03af..ef861ab022958 100644 --- a/javascript/node/selenium-webdriver/test/lib/by_test.js +++ b/javascript/node/selenium-webdriver/test/lib/by_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const by = require('../../lib/by') describe('by', function () { diff --git a/javascript/node/selenium-webdriver/test/lib/capabilities_test.js b/javascript/node/selenium-webdriver/test/lib/capabilities_test.js index 676a4ad947377..eff3e0b85f58a 100644 --- a/javascript/node/selenium-webdriver/test/lib/capabilities_test.js +++ b/javascript/node/selenium-webdriver/test/lib/capabilities_test.js @@ -24,8 +24,8 @@ const chrome = require('../../chrome') const { Browser, By, until } = require('../../') const remote = require('../../remote') -const assert = require('assert') -const fs = require('fs') +const assert = require('node:assert') +const fs = require('node:fs') const io = require('../../io') const Pages = test.Pages diff --git a/javascript/node/selenium-webdriver/test/lib/credentials_test.js b/javascript/node/selenium-webdriver/test/lib/credentials_test.js index e5dddba651997..358605dfa5bad 100644 --- a/javascript/node/selenium-webdriver/test/lib/credentials_test.js +++ b/javascript/node/selenium-webdriver/test/lib/credentials_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const virtualAuthenticatorCredential = require('../../lib/virtual_authenticator').Credential describe('Credentials', function () { diff --git a/javascript/node/selenium-webdriver/test/lib/error_test.js b/javascript/node/selenium-webdriver/test/lib/error_test.js index 399a128ed0643..612f348b1c4ce 100644 --- a/javascript/node/selenium-webdriver/test/lib/error_test.js +++ b/javascript/node/selenium-webdriver/test/lib/error_test.js @@ -18,7 +18,7 @@ 'use strict' describe('error', function () { - let assert = require('assert') + let assert = require('node:assert') let error = require('../../lib/error') describe('encodeError', function () { diff --git a/javascript/node/selenium-webdriver/test/lib/form_submit_test.js b/javascript/node/selenium-webdriver/test/lib/form_submit_test.js index 1d74e0e2a5c40..8feeb7e0ae1e3 100644 --- a/javascript/node/selenium-webdriver/test/lib/form_submit_test.js +++ b/javascript/node/selenium-webdriver/test/lib/form_submit_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../../lib/test') const until = require('../../lib/until') const Pages = test.Pages diff --git a/javascript/node/selenium-webdriver/test/lib/http_test.js b/javascript/node/selenium-webdriver/test/lib/http_test.js index 7872be70ac50c..da7855e94ef20 100644 --- a/javascript/node/selenium-webdriver/test/lib/http_test.js +++ b/javascript/node/selenium-webdriver/test/lib/http_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert'), +const assert = require('node:assert'), sinon = require('sinon') const Capabilities = require('../../lib/capabilities').Capabilities, diff --git a/javascript/node/selenium-webdriver/test/lib/input_test.js b/javascript/node/selenium-webdriver/test/lib/input_test.js index 5f34fcef60fd3..b71a5343aff45 100644 --- a/javascript/node/selenium-webdriver/test/lib/input_test.js +++ b/javascript/node/selenium-webdriver/test/lib/input_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const command = require('../../lib/command') const error = require('../../lib/error') const input = require('../../lib/input') diff --git a/javascript/node/selenium-webdriver/test/lib/logging_test.js b/javascript/node/selenium-webdriver/test/lib/logging_test.js index 5c434d264df5a..d7ce7eb0effbf 100644 --- a/javascript/node/selenium-webdriver/test/lib/logging_test.js +++ b/javascript/node/selenium-webdriver/test/lib/logging_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const sinon = require('sinon') const logging = require('../../lib/logging') diff --git a/javascript/node/selenium-webdriver/test/lib/promise_test.js b/javascript/node/selenium-webdriver/test/lib/promise_test.js index 757b1950d99a5..03e958894c60c 100644 --- a/javascript/node/selenium-webdriver/test/lib/promise_test.js +++ b/javascript/node/selenium-webdriver/test/lib/promise_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const testutil = require('./testutil') const promise = require('../../lib/promise') diff --git a/javascript/node/selenium-webdriver/test/lib/testutil.js b/javascript/node/selenium-webdriver/test/lib/testutil.js index b89d0f8d55868..bb27df154ac0c 100644 --- a/javascript/node/selenium-webdriver/test/lib/testutil.js +++ b/javascript/node/selenium-webdriver/test/lib/testutil.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const sinon = require('sinon') class StubError extends Error { diff --git a/javascript/node/selenium-webdriver/test/lib/until_test.js b/javascript/node/selenium-webdriver/test/lib/until_test.js index 6e0178e3e833c..5f73d3a3fd0d5 100644 --- a/javascript/node/selenium-webdriver/test/lib/until_test.js +++ b/javascript/node/selenium-webdriver/test/lib/until_test.js @@ -17,14 +17,14 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const By = require('../../lib/by').By const CommandName = require('../../lib/command').Name const error = require('../../lib/error') const until = require('../../lib/until') -const webdriver = require('../../lib/webdriver'), - WebElement = webdriver.WebElement +const webdriver = require('../../lib/webdriver') +const WebElement = webdriver.WebElement describe('until', function () { let driver, executor diff --git a/javascript/node/selenium-webdriver/test/lib/virtualauthenticatoroptions_test.js b/javascript/node/selenium-webdriver/test/lib/virtualauthenticatoroptions_test.js index e4837bcf162c5..f5fa4b445d0c2 100644 --- a/javascript/node/selenium-webdriver/test/lib/virtualauthenticatoroptions_test.js +++ b/javascript/node/selenium-webdriver/test/lib/virtualauthenticatoroptions_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const virtualAuthenticatorOptions = require('../../lib/virtual_authenticator').VirtualAuthenticatorOptions const Transport = require('../../lib/virtual_authenticator').Transport const Protocol = require('../../lib/virtual_authenticator').Protocol diff --git a/javascript/node/selenium-webdriver/test/lib/webdriver_test.js b/javascript/node/selenium-webdriver/test/lib/webdriver_test.js index 9ca6a88e96359..2ac37691d8fa0 100644 --- a/javascript/node/selenium-webdriver/test/lib/webdriver_test.js +++ b/javascript/node/selenium-webdriver/test/lib/webdriver_test.js @@ -28,7 +28,7 @@ const { By } = require('../../lib/by') const { Capabilities } = require('../../lib/capabilities') const { Name } = require('../../lib/command') const { Session } = require('../../lib/session') -const assert = require('assert') +const assert = require('node:assert') const CName = Name const SESSION_ID = 'test_session_id' diff --git a/javascript/node/selenium-webdriver/test/logging_test.js b/javascript/node/selenium-webdriver/test/logging_test.js index dace989d9471b..dfbdf0f71b715 100644 --- a/javascript/node/selenium-webdriver/test/logging_test.js +++ b/javascript/node/selenium-webdriver/test/logging_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const { Browser, logging } = require('..') diff --git a/javascript/node/selenium-webdriver/test/net/index_test.js b/javascript/node/selenium-webdriver/test/net/index_test.js index 85ad982765588..c9c1f7e3220d4 100644 --- a/javascript/node/selenium-webdriver/test/net/index_test.js +++ b/javascript/node/selenium-webdriver/test/net/index_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const net = require('../../net') describe('net.splitHostAndPort', function () { diff --git a/javascript/node/selenium-webdriver/test/net/portprober_test.js b/javascript/node/selenium-webdriver/test/net/portprober_test.js index a5c3f75a55fb4..86b6a1c04f99f 100644 --- a/javascript/node/selenium-webdriver/test/net/portprober_test.js +++ b/javascript/node/selenium-webdriver/test/net/portprober_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const net = require('net') +const assert = require('node:assert') +const net = require('node:net') const portprober = require('../../net/portprober') const host = '127.0.0.1' diff --git a/javascript/node/selenium-webdriver/test/page_loading_test.js b/javascript/node/selenium-webdriver/test/page_loading_test.js index 20738599d8684..f02e1ecccca8c 100644 --- a/javascript/node/selenium-webdriver/test/page_loading_test.js +++ b/javascript/node/selenium-webdriver/test/page_loading_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const error = require('../lib/error') const test = require('../lib/test') const { Browser, By, until } = require('..') diff --git a/javascript/node/selenium-webdriver/test/print_pdf_test.js b/javascript/node/selenium-webdriver/test/print_pdf_test.js index a8684dc517bf8..4a932c3226f89 100644 --- a/javascript/node/selenium-webdriver/test/print_pdf_test.js +++ b/javascript/node/selenium-webdriver/test/print_pdf_test.js @@ -20,7 +20,7 @@ const test = require('../lib/test') const { Pages } = require('../lib/test') const { Browser } = require('../') -const assert = require('assert') +const assert = require('node:assert') let startIndex = 0 let endIndex = 5 diff --git a/javascript/node/selenium-webdriver/test/proxy_test.js b/javascript/node/selenium-webdriver/test/proxy_test.js index 7cb80af838fb4..14b181051fa5d 100644 --- a/javascript/node/selenium-webdriver/test/proxy_test.js +++ b/javascript/node/selenium-webdriver/test/proxy_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const { URL } = require('url') +const assert = require('node:assert') +const { URL } = require('node:url') const proxy = require('../proxy') const test = require('../lib/test') const { Browser } = require('..') diff --git a/javascript/node/selenium-webdriver/test/rect_test.js b/javascript/node/selenium-webdriver/test/rect_test.js index fc2ffc0df1ca5..bbcbfeb7b26a8 100644 --- a/javascript/node/selenium-webdriver/test/rect_test.js +++ b/javascript/node/selenium-webdriver/test/rect_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { By } = require('..') const test = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/remote_test.js b/javascript/node/selenium-webdriver/test/remote_test.js index 8b5cf92cf3950..565150c09fed5 100644 --- a/javascript/node/selenium-webdriver/test/remote_test.js +++ b/javascript/node/selenium-webdriver/test/remote_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const path = require('path') +const assert = require('node:assert') +const path = require('node:path') const io = require('../io') const cmd = require('../lib/command') const remote = require('../remote') diff --git a/javascript/node/selenium-webdriver/test/safari_test.js b/javascript/node/selenium-webdriver/test/safari_test.js index 3f550489dea0b..9968ba1f5b3ee 100644 --- a/javascript/node/selenium-webdriver/test/safari_test.js +++ b/javascript/node/selenium-webdriver/test/safari_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const safari = require('../safari') const test = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/select_test.js b/javascript/node/selenium-webdriver/test/select_test.js index 00c0683b6bb3a..b6dc61377f067 100644 --- a/javascript/node/selenium-webdriver/test/select_test.js +++ b/javascript/node/selenium-webdriver/test/select_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { Select, By } = require('..') const { Pages, suite } = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/stale_element_test.js b/javascript/node/selenium-webdriver/test/stale_element_test.js index 0dbbf8a126509..e06ce98b0e72f 100644 --- a/javascript/node/selenium-webdriver/test/stale_element_test.js +++ b/javascript/node/selenium-webdriver/test/stale_element_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const { Browser, By, error, until } = require('..') const Pages = test.Pages diff --git a/javascript/node/selenium-webdriver/test/upload_test.js b/javascript/node/selenium-webdriver/test/upload_test.js index 557473b3b9cc0..297143eaed5dc 100644 --- a/javascript/node/selenium-webdriver/test/upload_test.js +++ b/javascript/node/selenium-webdriver/test/upload_test.js @@ -17,8 +17,8 @@ 'use strict' -const assert = require('assert') -const fs = require('fs') +const assert = require('node:assert') +const fs = require('node:fs') const io = require('../io') const remote = require('../remote') const test = require('../lib/test') diff --git a/javascript/node/selenium-webdriver/test/virtualAuthenticator_test.js b/javascript/node/selenium-webdriver/test/virtualAuthenticator_test.js index 85de2c67e4206..96c7923890755 100644 --- a/javascript/node/selenium-webdriver/test/virtualAuthenticator_test.js +++ b/javascript/node/selenium-webdriver/test/virtualAuthenticator_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const virtualAuthenticatorCredential = require('../lib/virtual_authenticator').Credential const virtualAuthenticatorOptions = require('../lib/virtual_authenticator').VirtualAuthenticatorOptions const Protocol = require('../lib/virtual_authenticator').Protocol diff --git a/javascript/node/selenium-webdriver/test/webComponent_test.js b/javascript/node/selenium-webdriver/test/webComponent_test.js index 4b46d069447c8..64db4fbf76723 100644 --- a/javascript/node/selenium-webdriver/test/webComponent_test.js +++ b/javascript/node/selenium-webdriver/test/webComponent_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const { By, error } = require('..') const test = require('../lib/test') const Pages = test.Pages diff --git a/javascript/node/selenium-webdriver/test/window_test.js b/javascript/node/selenium-webdriver/test/window_test.js index c526125f24951..d30ccf0d80e81 100644 --- a/javascript/node/selenium-webdriver/test/window_test.js +++ b/javascript/node/selenium-webdriver/test/window_test.js @@ -17,7 +17,7 @@ 'use strict' -const assert = require('assert') +const assert = require('node:assert') const test = require('../lib/test') const { By } = require('..') const { UnknownCommandError } = require('../lib/error') diff --git a/javascript/node/selenium-webdriver/testing/index.js b/javascript/node/selenium-webdriver/testing/index.js index 7fbadee62d0c3..85280987f77b6 100644 --- a/javascript/node/selenium-webdriver/testing/index.js +++ b/javascript/node/selenium-webdriver/testing/index.js @@ -32,7 +32,7 @@ 'use strict' -const { isatty } = require('tty') +const { isatty } = require('node:tty') const chrome = require('../chrome') const edge = require('../edge') const firefox = require('../firefox') @@ -406,7 +406,6 @@ function suite(fn, options = undefined) { const startTimeout = 65 * 1000 - // eslint-disable-next-line no-inner-declarations function startSelenium() { if (typeof this.timeout === 'function') { this.timeout(startTimeout) // For mocha. diff --git a/javascript/node/selenium-webdriver/tools/init_jasmine.js b/javascript/node/selenium-webdriver/tools/init_jasmine.js index 60da5ef51ee87..2c2313c9c5d05 100644 --- a/javascript/node/selenium-webdriver/tools/init_jasmine.js +++ b/javascript/node/selenium-webdriver/tools/init_jasmine.js @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -// eslint-disable-next-line node/no-missing-require -require('@bazel/jasmine').boot() // eslint-disable-line node/no-extraneous-require +// eslint-disable-next-line n/no-missing-require +require('@bazel/jasmine').boot() global.after = global.afterAll global.before = global.beforeAll diff --git a/package-lock.json b/package-lock.json index 33e1c0f9b3c5b..9e8a5e2a8f927 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1839,18 +1839,6 @@ "dev": true, "license": "0BSD" }, - "javascript/grid-ui/node_modules/typescript": { - "version": "4.9.5", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, "javascript/grid-ui/node_modules/unbox-primitive": { "version": "1.0.2", "dev": true, @@ -1895,12 +1883,15 @@ }, "devDependencies": { "@bazel/runfiles": "^5.8.1", + "@eslint/js": "^9.0.0", "eslint": "^9.0.0", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-mocha": "^10.4.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-no-only-tests": "^3.1.0", - "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^5.1.3", "express": "^4.19.2", + "globals": "^15.0.0", "mocha": "^10.4.0", "mocha-junit-reporter": "^2.2.1", "multer": "^1.4.5-lts.1", @@ -1935,13 +1926,16 @@ "url": "https://opencollective.com/eslint" } }, - "javascript/node/selenium-webdriver/node_modules/@eslint/js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.0.0.tgz", - "integrity": "sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==", + "javascript/node/selenium-webdriver/node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "javascript/node/selenium-webdriver/node_modules/@humanwhocodes/config-array": { @@ -2129,9 +2123,9 @@ } }, "javascript/node/selenium-webdriver/node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.0.0.tgz", + "integrity": "sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==", "dev": true, "engines": { "node": ">=18" @@ -3182,12 +3176,12 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.0.0.tgz", + "integrity": "sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@floating-ui/core": { @@ -4973,6 +4967,19 @@ "node": ">= 0.8" } }, + "node_modules/enhanced-resolve": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -5139,6 +5146,54 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-compat-utils": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.0.tgz", + "integrity": "sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==", + "dev": true, + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-compat-utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-compat-utils/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-compat-utils/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/eslint-config-prettier": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", @@ -5151,52 +5206,186 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-es": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", - "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "node_modules/eslint-plugin-es-x": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.6.0.tgz", + "integrity": "sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==", "dev": true, "dependencies": { - "eslint-utils": "^2.0.0", - "regexpp": "^3.0.0" + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.6.0", + "eslint-compat-utils": "^0.5.0" }, "engines": { - "node": ">=8.10.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, + "node_modules/eslint-plugin-mocha": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.2.tgz", + "integrity": "sha512-cur4dVYnSEWTBwdqIBQFxa/9siAhesu0TX+lbJ4ClE9j0eNMNe6BSx3vkFFNz6tGoveyMyELFXa30f3fvuAVDg==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "globals": "^13.24.0", + "rambda": "^7.4.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-mocha/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { - "eslint": ">=4.19.1" + "eslint": ">=5" } }, - "node_modules/eslint-plugin-no-only-tests": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.1.0.tgz", - "integrity": "sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==", + "node_modules/eslint-plugin-mocha/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { - "node": ">=5.0.0" + "node": ">=10" } }, - "node_modules/eslint-plugin-node": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", - "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "node_modules/eslint-plugin-mocha/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { - "eslint-plugin-es": "^3.0.0", - "eslint-utils": "^2.0.0", - "ignore": "^5.1.1", - "minimatch": "^3.0.4", - "resolve": "^1.10.1", - "semver": "^6.1.0" + "type-fest": "^0.20.2" }, "engines": { - "node": ">=8.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-n": { + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.2.1.tgz", + "integrity": "sha512-uW1+df2bo06kR7ix6nB614RUlvjRPrYxlaX832O6e1MCJp4V7YozEdvMgCYuvn4ltnjPu1FVYhQ2KRrmTNoJfg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "enhanced-resolve": "^5.15.0", + "eslint-plugin-es-x": "^7.5.0", + "get-tsconfig": "^4.7.0", + "globals": "^14.0.0", + "ignore": "^5.2.4", + "minimatch": "^9.0.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { - "eslint": ">=5.16.0" + "eslint": ">=8.23.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-n/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-n/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-n/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/eslint-plugin-no-only-tests": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.1.0.tgz", + "integrity": "sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==", + "dev": true, + "engines": { + "node": ">=5.0.0" } }, "node_modules/eslint-plugin-prettier": { @@ -5245,30 +5434,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -5281,6 +5446,15 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -5744,6 +5918,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -7800,6 +7986,12 @@ } ] }, + "node_modules/rambda": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/rambda/-/rambda-7.5.0.tgz", + "integrity": "sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -8039,6 +8231,15 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/response-iterator": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", @@ -8615,6 +8816,15 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -8725,6 +8935,19 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 009728a6663f3..a51d0c94fb8b0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,24 +111,33 @@ importers: '@bazel/runfiles': specifier: ^5.8.1 version: 5.8.1 + '@eslint/js': + specifier: ^9.0.0 + version: 9.0.0 eslint: specifier: ^9.0.0 version: 9.0.0 eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.0.0) + eslint-plugin-mocha: + specifier: ^10.4.2 + version: 10.4.2(eslint@9.0.0) + eslint-plugin-n: + specifier: ^17.2.1 + version: 17.2.1(eslint@9.0.0) eslint-plugin-no-only-tests: specifier: ^3.1.0 version: 3.1.0 - eslint-plugin-node: - specifier: ^11.1.0 - version: 11.1.0(eslint@9.0.0) eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@9.0.0)(prettier@3.2.5) express: specifier: ^4.19.2 version: 4.19.2 + globals: + specifier: ^15.0.0 + version: 15.0.0 mocha: specifier: ^10.4.0 version: 10.4.0 @@ -822,7 +831,7 @@ packages: ajv: 6.12.6 debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 - globals: 13.23.0 + globals: 13.24.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -2187,6 +2196,14 @@ packages: engines: {node: '>= 0.8'} dev: true + /enhanced-resolve@5.16.0: + resolution: {integrity: sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==} + engines: {node: '>=10.13.0'} + dependencies: + graceful-fs: 4.2.10 + tapable: 2.2.1 + dev: true + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -2300,6 +2317,16 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + /eslint-compat-utils@0.5.0(eslint@9.0.0): + resolution: {integrity: sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 9.0.0 + semver: 7.5.4 + dev: true + /eslint-config-prettier@9.1.0(eslint@9.0.0): resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true @@ -2393,15 +2420,16 @@ packages: - supports-color dev: true - /eslint-plugin-es@3.0.1(eslint@9.0.0): - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} + /eslint-plugin-es-x@7.6.0(eslint@9.0.0): + resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=4.19.1' + eslint: '>=8' dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@eslint-community/regexpp': 4.9.1 eslint: 9.0.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) dev: true /eslint-plugin-es@4.1.0(eslint@8.52.0): @@ -2446,6 +2474,18 @@ packages: - supports-color dev: true + /eslint-plugin-mocha@10.4.2(eslint@9.0.0): + resolution: {integrity: sha512-cur4dVYnSEWTBwdqIBQFxa/9siAhesu0TX+lbJ4ClE9j0eNMNe6BSx3vkFFNz6tGoveyMyELFXa30f3fvuAVDg==} + engines: {node: '>=14.0.0'} + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 9.0.0 + eslint-utils: 3.0.0(eslint@9.0.0) + globals: 13.24.0 + rambda: 7.5.0 + dev: true + /eslint-plugin-n@15.5.1(eslint@8.52.0): resolution: {integrity: sha512-kAd+xhZm7brHoFLzKLB7/FGRFJNg/srmv67mqb7tto22rpr4wv/LV6RuXzAfv3jbab7+k1wi42PsIhGviywaaw==} engines: {node: '>=12.22.0'} @@ -2463,24 +2503,26 @@ packages: semver: 7.5.4 dev: true - /eslint-plugin-no-only-tests@3.1.0: - resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} - engines: {node: '>=5.0.0'} - dev: true - - /eslint-plugin-node@11.1.0(eslint@9.0.0): - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} + /eslint-plugin-n@17.2.1(eslint@9.0.0): + resolution: {integrity: sha512-uW1+df2bo06kR7ix6nB614RUlvjRPrYxlaX832O6e1MCJp4V7YozEdvMgCYuvn4ltnjPu1FVYhQ2KRrmTNoJfg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '>=5.16.0' + eslint: '>=8.23.0' dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + enhanced-resolve: 5.16.0 eslint: 9.0.0 - eslint-plugin-es: 3.0.1(eslint@9.0.0) - eslint-utils: 2.1.0 + eslint-plugin-es-x: 7.6.0(eslint@9.0.0) + get-tsconfig: 4.7.3 + globals: 14.0.0 ignore: 5.2.4 - minimatch: 3.1.2 - resolve: 1.22.1 - semver: 6.3.1 + minimatch: 9.0.4 + semver: 7.5.4 + dev: true + + /eslint-plugin-no-only-tests@3.1.0: + resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} + engines: {node: '>=5.0.0'} dev: true /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@9.0.0)(prettier@3.2.5): @@ -2578,6 +2620,16 @@ packages: eslint-visitor-keys: 2.1.0 dev: true + /eslint-utils@3.0.0(eslint@9.0.0): + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + dependencies: + eslint: 9.0.0 + eslint-visitor-keys: 2.1.0 + dev: true + /eslint-visitor-keys@1.3.0: resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} engines: {node: '>=4'} @@ -2626,7 +2678,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.23.0 + globals: 13.24.0 graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 @@ -2996,6 +3048,12 @@ packages: get-intrinsic: 1.1.3 dev: true + /get-tsconfig@4.7.3: + resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -3035,8 +3093,8 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - /globals@13.23.0: - resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -3047,6 +3105,11 @@ packages: engines: {node: '>=18'} dev: true + /globals@15.0.0: + resolution: {integrity: sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==} + engines: {node: '>=18'} + dev: true + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -3723,6 +3786,13 @@ packages: dependencies: brace-expansion: 2.0.1 + /minimatch@9.0.4: + resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} @@ -4173,6 +4243,10 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true + /rambda@7.5.0: + resolution: {integrity: sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==} + dev: true + /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: @@ -4326,6 +4400,10 @@ packages: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /resolve@1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true @@ -4674,6 +4752,11 @@ packages: tslib: 2.6.2 dev: true + /tapable@2.2.1: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + dev: true + /temp@0.9.4: resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==} engines: {node: '>=6.0.0'}