diff --git a/.eslintrc.json b/.eslintrc.json index 048df35bc1a..1ed8c9c0933 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,6 +6,10 @@ "eslint:recommended", "standard" ], + "plugins": [ + "mocha", + "n" + ], "env": { "node": true, "es2020": true @@ -18,6 +22,7 @@ "object-curly-spacing": [2, "always"], "import/no-extraneous-dependencies": 2, "standard/no-callback-literal": 0, - "no-prototype-builtins": 0 + "no-prototype-builtins": 0, + "n/no-restricted-require": [2, ["diagnostics_channel"]] } } diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index eef6b00befd..9fa9aca24cc 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -40,6 +40,7 @@ dev,esbuild,MIT,Copyright (c) 2020 Evan Wallace dev,eslint,MIT,Copyright JS Foundation and other contributors https://js.foundation dev,eslint-config-standard,MIT,Copyright Feross Aboukhadijeh dev,eslint-plugin-import,MIT,Copyright 2015 Ben Mosher +dev,eslint-plugin-n,MIT,Copyright 2015 Toru Nagashima dev,eslint-plugin-node,MIT,Copyright 2015 Toru Nagashima dev,eslint-plugin-promise,ISC,jden and other contributors dev,eslint-plugin-standard,MIT,Copyright 2015 Jamund Ferguson diff --git a/package.json b/package.json index 9227b57f115..5dfb61cfee0 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,7 @@ "eslint": "^8.23.0", "eslint-config-standard": "^11.0.0-beta.0", "eslint-plugin-import": "^2.8.0", + "eslint-plugin-n": "^15.7.0", "eslint-plugin-node": "^5.2.1", "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", diff --git a/packages/datadog-core/src/storage/async_resource.js b/packages/datadog-core/src/storage/async_resource.js index 2c99e06b70d..bf64f31126a 100644 --- a/packages/datadog-core/src/storage/async_resource.js +++ b/packages/datadog-core/src/storage/async_resource.js @@ -1,7 +1,7 @@ 'use strict' const { createHook, executionAsyncResource } = require('async_hooks') -const { channel } = require('diagnostics_channel') +const { channel } = require('../../../diagnostics_channel') const beforeCh = channel('dd-trace:storage:before') const afterCh = channel('dd-trace:storage:after') diff --git a/packages/datadog-instrumentations/src/helpers/instrument.js b/packages/datadog-instrumentations/src/helpers/instrument.js index fb1931ca256..51ab92fc629 100644 --- a/packages/datadog-instrumentations/src/helpers/instrument.js +++ b/packages/datadog-instrumentations/src/helpers/instrument.js @@ -1,6 +1,6 @@ 'use strict' -const dc = require('diagnostics_channel') +const dc = require('../../../diagnostics_channel') const semver = require('semver') const instrumentations = require('./instrumentations') const { AsyncResource } = require('async_hooks') diff --git a/packages/datadog-instrumentations/src/helpers/register.js b/packages/datadog-instrumentations/src/helpers/register.js index ad90184ed80..a4484b9d8c8 100644 --- a/packages/datadog-instrumentations/src/helpers/register.js +++ b/packages/datadog-instrumentations/src/helpers/register.js @@ -1,6 +1,6 @@ 'use strict' -const { channel } = require('diagnostics_channel') +const { channel } = require('../../../diagnostics_channel') const path = require('path') const semver = require('semver') const Hook = require('./hook') diff --git a/packages/dd-trace/src/appsec/gateway/channels.js b/packages/dd-trace/src/appsec/gateway/channels.js index f06ef25fc81..42185345b6a 100644 --- a/packages/dd-trace/src/appsec/gateway/channels.js +++ b/packages/dd-trace/src/appsec/gateway/channels.js @@ -1,6 +1,6 @@ 'use strict' -const dc = require('diagnostics_channel') +const dc = require('../../../../diagnostics_channel') // TODO: use TBD naming convention // or directly use http plugin's channels diff --git a/packages/dd-trace/src/appsec/iast/index.js b/packages/dd-trace/src/appsec/iast/index.js index 2102ea6ad88..21e9813521c 100644 --- a/packages/dd-trace/src/appsec/iast/index.js +++ b/packages/dd-trace/src/appsec/iast/index.js @@ -3,7 +3,7 @@ const { enableAllAnalyzers, disableAllAnalyzers } = require('./analyzers') const web = require('../../plugins/util/web') const { storage } = require('../../../../datadog-core') const overheadController = require('./overhead-controller') -const dc = require('diagnostics_channel') +const dc = require('../../../../diagnostics_channel') const iastContextFunctions = require('./iast-context') const { enableTaintTracking, disableTaintTracking, createTransaction, removeTransaction } = require('./taint-tracking') diff --git a/packages/dd-trace/src/appsec/iast/telemetry/logs.js b/packages/dd-trace/src/appsec/iast/telemetry/logs.js index dcc356b8eab..08b75e399fa 100644 --- a/packages/dd-trace/src/appsec/iast/telemetry/logs.js +++ b/packages/dd-trace/src/appsec/iast/telemetry/logs.js @@ -1,6 +1,6 @@ 'use strict' -const dc = require('diagnostics_channel') +const dc = require('../../../../../diagnostics_channel') const logCollector = require('./log_collector') const { sendData } = require('../../../telemetry/send-data') const log = require('../../../log') diff --git a/packages/dd-trace/src/dcitm.js b/packages/dd-trace/src/dcitm.js index 8a61a4f36e8..8580c94924a 100644 --- a/packages/dd-trace/src/dcitm.js +++ b/packages/dd-trace/src/dcitm.js @@ -1,5 +1,7 @@ 'use strict' +// TODO: Figure out why we can't use the internal version. +// eslint-disable-next-line n/no-restricted-require const dc = require('diagnostics_channel') const CHANNEL_PREFIX = 'dd-trace:bundledModuleLoadStart' diff --git a/packages/dd-trace/src/iitm.js b/packages/dd-trace/src/iitm.js index 11b1e41f9a9..217f0919b39 100644 --- a/packages/dd-trace/src/iitm.js +++ b/packages/dd-trace/src/iitm.js @@ -3,7 +3,7 @@ const semver = require('semver') const logger = require('./log') const { addHook } = require('import-in-the-middle') -const dc = require('diagnostics_channel') +const dc = require('../../diagnostics_channel') if (semver.satisfies(process.versions.node, '^12.20.0 || >=14.13.1')) { const moduleLoadStartChannel = dc.channel('dd-trace:moduleLoadStart') diff --git a/packages/dd-trace/src/log/channels.js b/packages/dd-trace/src/log/channels.js index 38add8901f4..0921f7f05a0 100644 --- a/packages/dd-trace/src/log/channels.js +++ b/packages/dd-trace/src/log/channels.js @@ -1,6 +1,6 @@ 'use strict' -const dc = require('diagnostics_channel') +const { channel } = require('../../../diagnostics_channel') const Level = { Debug: 'debug', @@ -11,19 +11,18 @@ const Level = { const defaultLevel = Level.Debug -class LogChannel extends dc.Channel { - constructor (name, logLevel) { - super(`datadog:log:${name}`) - this.logLevel = logLevel - } -} - // based on: https://github.com/trentm/node-bunyan#levels const logChannels = { - [Level.Debug]: new LogChannel(Level.Debug, 20), - [Level.Info]: new LogChannel(Level.Info, 30), - [Level.Warn]: new LogChannel(Level.Warn, 40), - [Level.Error]: new LogChannel(Level.Error, 50) + [Level.Debug]: createLogChannel(Level.Debug, 20), + [Level.Info]: createLogChannel(Level.Info, 30), + [Level.Warn]: createLogChannel(Level.Warn, 40), + [Level.Error]: createLogChannel(Level.Error, 50) +} + +function createLogChannel (name, logLevel) { + const logChannel = channel(`datadog:log:${name}`) + logChannel.logLevel = logLevel + return logChannel } function getChannelLogLevel (level) { diff --git a/packages/dd-trace/src/plugin_manager.js b/packages/dd-trace/src/plugin_manager.js index 9e035e716ec..7bbfbaeef6b 100644 --- a/packages/dd-trace/src/plugin_manager.js +++ b/packages/dd-trace/src/plugin_manager.js @@ -1,6 +1,6 @@ 'use strict' -const { channel } = require('diagnostics_channel') +const { channel } = require('../../diagnostics_channel') const { isFalse } = require('./util') const plugins = require('./plugins') const log = require('./log') diff --git a/packages/dd-trace/src/plugins/plugin.js b/packages/dd-trace/src/plugins/plugin.js index e168828ce16..a5cff11b498 100644 --- a/packages/dd-trace/src/plugins/plugin.js +++ b/packages/dd-trace/src/plugins/plugin.js @@ -2,7 +2,7 @@ // TODO: move anything related to tracing to TracingPlugin instead -const dc = require('diagnostics_channel') +const dc = require('../../../diagnostics_channel') const { storage } = require('../../../datadog-core') class Subscription { diff --git a/packages/dd-trace/src/profiling/profilers/cpu.js b/packages/dd-trace/src/profiling/profilers/cpu.js index 61fa63e9871..3be1ecce548 100644 --- a/packages/dd-trace/src/profiling/profilers/cpu.js +++ b/packages/dd-trace/src/profiling/profilers/cpu.js @@ -2,7 +2,7 @@ const { storage } = require('../../../../datadog-core') -const dc = require('diagnostics_channel') +const dc = require('../../../../diagnostics_channel') const beforeCh = dc.channel('dd-trace:storage:before') const afterCh = dc.channel('dd-trace:storage:after') diff --git a/packages/dd-trace/src/ritm.js b/packages/dd-trace/src/ritm.js index 663167534b2..5e6fcf414a8 100644 --- a/packages/dd-trace/src/ritm.js +++ b/packages/dd-trace/src/ritm.js @@ -3,7 +3,7 @@ const path = require('path') const Module = require('module') const parse = require('module-details-from-path') -const dc = require('diagnostics_channel') +const dc = require('../../diagnostics_channel') const origRequire = Module.prototype.require diff --git a/packages/dd-trace/src/telemetry/dependencies.js b/packages/dd-trace/src/telemetry/dependencies.js index 42b96206554..3d190a7cde3 100644 --- a/packages/dd-trace/src/telemetry/dependencies.js +++ b/packages/dd-trace/src/telemetry/dependencies.js @@ -4,7 +4,7 @@ const path = require('path') const parse = require('module-details-from-path') const requirePackageJson = require('../require-package-json') const { sendData } = require('./send-data') -const dc = require('diagnostics_channel') +const dc = require('../../../diagnostics_channel') const { fileURLToPath } = require('url') const savedDependencies = new Set() diff --git a/packages/dd-trace/src/telemetry/index.js b/packages/dd-trace/src/telemetry/index.js index 2cc66223c1b..32c9e6a5f2f 100644 --- a/packages/dd-trace/src/telemetry/index.js +++ b/packages/dd-trace/src/telemetry/index.js @@ -1,7 +1,7 @@ 'use strict' const tracerVersion = require('../../../../package.json').version -const dc = require('diagnostics_channel') +const dc = require('../../../diagnostics_channel') const os = require('os') const dependencies = require('./dependencies') const { sendData } = require('./send-data') diff --git a/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js b/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js index 7466d563395..dc86db68b49 100644 --- a/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js +++ b/packages/dd-trace/test/appsec/iast/analyzers/vulnerability-analyzer.spec.js @@ -154,7 +154,7 @@ describe('vulnerability-analyzer', () => { expect(vulnerabilityAnalyzer._subscriptions).to.have.lengthOf(1) vulnerabilityAnalyzer._subscriptions[0].enable() - const dc = require('diagnostics_channel') + const dc = require('../../../../../diagnostics_channel') expect(() => { dc.channel('dd-trace:test:error:sub').publish({}) }).to.not.throw() }) }) diff --git a/packages/dd-trace/test/appsec/iast/iast-log.spec.js b/packages/dd-trace/test/appsec/iast/iast-log.spec.js index d9212a07401..b520cad66bf 100644 --- a/packages/dd-trace/test/appsec/iast/iast-log.spec.js +++ b/packages/dd-trace/test/appsec/iast/iast-log.spec.js @@ -58,7 +58,7 @@ describe('IAST log', () => { error: sinon.stub() } telemetryLogs = proxyquire('../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': { + '../../../../../diagnostics_channel': { channel: (name) => name === 'datadog:telemetry:start' ? telemetryStartChannel : telemetryStopChannel } }) diff --git a/packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js b/packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js index 4da054ed778..409978799e9 100644 --- a/packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js +++ b/packages/dd-trace/test/appsec/iast/telemetry/logs.spec.js @@ -49,7 +49,7 @@ describe('telemetry logs', () => { describe('start', () => { it('should be enabled by default and subscribe', () => { const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc + '../../../../../diagnostics_channel': dc }) logs.start() defaultConfig.telemetry.logCollection = true @@ -61,7 +61,7 @@ describe('telemetry logs', () => { it('should be disabled and not subscribe if DD_TELEMETRY_LOG_COLLECTION_ENABLED = false', () => { const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc + '../../../../../diagnostics_channel': dc }) logs.start() @@ -76,7 +76,7 @@ describe('telemetry logs', () => { let logCollectorCalled = 0 const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc, + '../../../../../diagnostics_channel': dc, '../../../telemetry/send-data': { sendData }, './log_collector': { drain: () => { @@ -105,7 +105,7 @@ describe('telemetry logs', () => { describe('stop', () => { it('should unsubscribe configured listeners', () => { const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc + '../../../../../diagnostics_channel': dc }) logs.start() onTelemetryStart()(onTelemetryStartMsg) @@ -118,7 +118,7 @@ describe('telemetry logs', () => { it('should unsubscribe configured listeners when datadog:telemetry:stop is received', () => { const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc + '../../../../../diagnostics_channel': dc }) logs.start() onTelemetryStart()(onTelemetryStartMsg) @@ -137,7 +137,7 @@ describe('telemetry logs', () => { it('should be called with DEBUG level and error if config.telemetry.debug = true', () => { const logCollectorAdd = sinon.stub() const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc, + '../../../../../diagnostics_channel': dc, './log_collector': { add: logCollectorAdd } @@ -159,7 +159,7 @@ describe('telemetry logs', () => { it('should be not called with DEBUG level if config.telemetry.debug = false', () => { const logCollectorAdd = sinon.stub() const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc, + '../../../../../diagnostics_channel': dc, './log_collector': { add: logCollectorAdd } @@ -175,7 +175,7 @@ describe('telemetry logs', () => { it('should be called with WARN level', () => { const logCollectorAdd = sinon.stub() const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc, + '../../../../../diagnostics_channel': dc, './log_collector': { add: logCollectorAdd } @@ -191,7 +191,7 @@ describe('telemetry logs', () => { it('should be called with ERROR level', () => { const logCollectorAdd = sinon.stub() const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc, + '../../../../../diagnostics_channel': dc, './log_collector': { add: logCollectorAdd } @@ -207,7 +207,7 @@ describe('telemetry logs', () => { it('should be called with ERROR level and stack_trace', () => { const logCollectorAdd = sinon.stub() const logs = proxyquire('../../../../src/appsec/iast/telemetry/logs', { - 'diagnostics_channel': dc, + '../../../../../diagnostics_channel': dc, './log_collector': { add: logCollectorAdd } diff --git a/packages/dd-trace/test/iitm.spec.js b/packages/dd-trace/test/iitm.spec.js index 384c4668d13..e5ba84d2fed 100644 --- a/packages/dd-trace/test/iitm.spec.js +++ b/packages/dd-trace/test/iitm.spec.js @@ -4,7 +4,7 @@ require('./setup/tap') const { expect } = require('chai') const semver = require('semver') -const dc = require('diagnostics_channel') +const dc = require('../../diagnostics_channel') describe('iitm.js', () => { let hookFn diff --git a/packages/dd-trace/test/plugin_manager.spec.js b/packages/dd-trace/test/plugin_manager.spec.js index 81ff342d0c4..22613326fae 100644 --- a/packages/dd-trace/test/plugin_manager.spec.js +++ b/packages/dd-trace/test/plugin_manager.spec.js @@ -2,7 +2,7 @@ require('./setup/tap') -const { channel } = require('diagnostics_channel') +const { channel } = require('../../diagnostics_channel') const proxyquire = require('proxyquire') const loadChannel = channel('dd-trace:instrumentation:load') diff --git a/packages/dd-trace/test/plugins/log_plugin.spec.js b/packages/dd-trace/test/plugins/log_plugin.spec.js index ceb0f4b47d5..4cc8d6aa9fe 100644 --- a/packages/dd-trace/test/plugins/log_plugin.spec.js +++ b/packages/dd-trace/test/plugins/log_plugin.spec.js @@ -6,7 +6,7 @@ const LogPlugin = require('../../src/plugins/log_plugin') const Tracer = require('../../src/tracer') const Config = require('../../src/config') -const { channel } = require('diagnostics_channel') +const { channel } = require('../../../diagnostics_channel') const { expect } = require('chai') const testLogChannel = channel('apm:test:log') diff --git a/packages/dd-trace/test/ritm.spec.js b/packages/dd-trace/test/ritm.spec.js index 8c7b7899989..212abc4758b 100644 --- a/packages/dd-trace/test/ritm.spec.js +++ b/packages/dd-trace/test/ritm.spec.js @@ -2,7 +2,7 @@ require('./setup/tap') -const dc = require('diagnostics_channel') +const dc = require('../../diagnostics_channel') const { assert } = require('chai') const Hook = require('../src/ritm') diff --git a/packages/dd-trace/test/telemetry/dependencies.spec.js b/packages/dd-trace/test/telemetry/dependencies.spec.js index 4ca91cac126..1b0a304ec60 100644 --- a/packages/dd-trace/test/telemetry/dependencies.spec.js +++ b/packages/dd-trace/test/telemetry/dependencies.spec.js @@ -4,7 +4,7 @@ require('../setup/tap') const proxyquire = require('proxyquire') const path = require('path') -const dc = require('diagnostics_channel') +const dc = require('../../../diagnostics_channel') const moduleLoadStartChannel = dc.channel('dd-trace:moduleLoadStart') const originalSetImmediate = global.setImmediate describe('dependencies', () => { @@ -13,7 +13,7 @@ describe('dependencies', () => { const subscribe = sinon.stub() const dc = { channel () { return { subscribe } } } const dependencies = proxyquire('../../src/telemetry/dependencies', { - 'diagnostics_channel': dc + '../../../diagnostics_channel': dc }) dependencies.start() expect(subscribe).to.have.been.calledOnce diff --git a/packages/diagnostics_channel/index.js b/packages/diagnostics_channel/index.js new file mode 100644 index 00000000000..ae91ce34dc5 --- /dev/null +++ b/packages/diagnostics_channel/index.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('./src') diff --git a/packages/diagnostics_channel/src/index.js b/packages/diagnostics_channel/src/index.js new file mode 100644 index 00000000000..ead90759dcc --- /dev/null +++ b/packages/diagnostics_channel/src/index.js @@ -0,0 +1,57 @@ +'use strict' + +const { + Channel, + channel +} = require('diagnostics_channel') // eslint-disable-line n/no-restricted-require + +const [major, minor] = process.versions.node.split('.') +const channels = new WeakSet() + +// Our own DC with a limited subset of functionality stable across Node versions. +// TODO: Move the rest of the polyfill here. +// TODO: Switch to using global subscribe/unsubscribe/hasSubscribers. +const dc = { channel } + +// Prevent going to 0 subscribers to avoid bug in Node. +// See https://github.com/nodejs/node/pull/47520 +if (major === '19' && minor === '9') { + dc.channel = function () { + const ch = channel.apply(this, arguments) + + if (!channels.has(ch)) { + const subscribe = ch.subscribe + const unsubscribe = ch.unsubscribe + + ch.subscribe = function () { + delete ch.subscribe + delete ch.unsubscribe + + const result = subscribe.apply(this, arguments) + + this.subscribe(() => {}) // Keep it active forever. + + return result + } + + if (ch.unsubscribe === Channel.prototype.unsubscribe) { + // Needed because another subscriber could have subscribed to something + // that we unsubscribe to before the library is loaded. + ch.unsubscribe = function () { + delete ch.subscribe + delete ch.unsubscribe + + this.subscribe(() => {}) // Keep it active forever. + + return unsubscribe.apply(this, arguments) + } + } + + channels.add(ch) + } + + return ch + } +} + +module.exports = dc diff --git a/yarn.lock b/yarn.lock index e9768efe6d4..30d73f13794 100644 --- a/yarn.lock +++ b/yarn.lock @@ -299,23 +299,6 @@ resolved "https://registry.yarnpkg.com/@datadog/sketches-js/-/sketches-js-2.1.0.tgz#8c7e8028a5fc22ad102fa542b0a446c956830455" integrity sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew== -"@eslint-community/eslint-utils@^4.2.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== - dependencies: - eslint-visitor-keys "^3.3.0" - -"@eslint-community/regexpp@^4.4.0": - version "4.4.1" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.1.tgz#087cb8d9d757bb22e9c9946c9c0c2bf8806830f1" - integrity sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw== - -"@eslint/eslintrc@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz#7888fe7ec8f21bc26d646dbd2c11cd776e21192d" - integrity sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw== - "@esbuild/android-arm64@0.16.12": version "0.16.12" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.16.12.tgz#86c4fdd7c0d65fe9dcbe138fbe72720658ec3b88" @@ -426,10 +409,22 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.16.12.tgz#31197bb509049b63c059c4808ac58e66fdff7479" integrity sha512-iPYKN78t3op2+erv2frW568j1q0RpqX6JOLZ7oPPaAV1VaF7dDstOrNw37PVOYoTWE11pV4A1XUitpdEFNIsPg== -"@eslint/eslintrc@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.2.tgz#58b69582f3b7271d8fa67fe5251767a5b38ea356" - integrity sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.1.tgz#087cb8d9d757bb22e9c9946c9c0c2bf8806830f1" + integrity sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw== + +"@eslint/eslintrc@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz#7888fe7ec8f21bc26d646dbd2c11cd776e21192d" + integrity sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -751,7 +746,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.12.4: +ajv@^6.10.0: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1044,6 +1039,13 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +builtins@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9" + integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ== + dependencies: + semver "^7.0.0" + busboy@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" @@ -1700,6 +1702,14 @@ eslint-module-utils@^2.7.4: dependencies: debug "^3.2.7" +eslint-plugin-es@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9" + integrity sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ== + dependencies: + eslint-utils "^2.0.0" + regexpp "^3.0.0" + eslint-plugin-import@^2.8.0: version "2.27.5" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" @@ -1721,6 +1731,20 @@ eslint-plugin-import@^2.8.0: semver "^6.3.0" tsconfig-paths "^3.14.1" +eslint-plugin-n@^15.7.0: + version "15.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz#e29221d8f5174f84d18f2eb94765f2eeea033b90" + integrity sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q== + dependencies: + builtins "^5.0.1" + eslint-plugin-es "^4.1.0" + eslint-utils "^3.0.0" + ignore "^5.1.1" + is-core-module "^2.11.0" + minimatch "^3.1.2" + resolve "^1.22.1" + semver "^7.3.8" + eslint-plugin-node@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz#80df3253c4d7901045ec87fa660a284e32bdca29" @@ -1749,6 +1773,30 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-utils@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + eslint-visitor-keys@^3.3.0: version "3.4.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" @@ -2332,7 +2380,7 @@ ignore@^3.3.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== -ignore@^5.2.0: +ignore@^5.1.1, ignore@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -2342,7 +2390,7 @@ immediate@~3.0.5: resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -2484,10 +2532,17 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.11.0, is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== +is-core-module@^2.11.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" + integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== + dependencies: + has "^1.0.3" + +is-core-module@^2.9.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== dependencies: has "^1.0.3" @@ -3636,6 +3691,11 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" +regexpp@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + reinterval@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/reinterval/-/reinterval-1.1.0.tgz#3361ecfa3ca6c18283380dd0bb9546f390f5ece7" @@ -3673,12 +3733,12 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.22.1, resolve@^1.3.3, resolve@~1.22.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== +resolve@^1.22.1, resolve@^1.3.3: + version "1.22.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== dependencies: - is-core-module "^2.9.0" + is-core-module "^2.11.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -3687,6 +3747,15 @@ resolve@~1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== +resolve@~1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -3780,6 +3849,13 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.0.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" + integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== + dependencies: + lru-cache "^6.0.0" + semver@^7.3.8: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" @@ -4029,7 +4105,7 @@ strip-bom@^4.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== -strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==