From ed9b01ff3430ee532aa3f9f409bfe5104241d1c1 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 7 Jan 2021 18:04:32 +0100 Subject: [PATCH 01/69] =?UTF-8?q?=F0=9F=94=A8=20Replace=20TSLint=20by=20ES?= =?UTF-8?q?Lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 3 + .eslintrc.js | 237 +++ package.json | 17 +- packages/core/src/browser/fetchProxy.ts | 2 +- .../src/domain/internalMonitoring.spec.ts | 2 +- .../core/src/domain/internalMonitoring.ts | 2 +- packages/core/src/domain/tracekit.spec.ts | 4 +- packages/core/src/domain/tracekit.ts | 14 +- .../core/src/domain/tracekitHandler.spec.ts | 2 +- .../core/src/domain/tracekitParser.spec.ts | 4 +- packages/core/src/tools/context.spec.ts | 8 +- .../core/src/tools/limitModification.spec.ts | 2 +- packages/core/src/tools/specHelper.ts | 4 +- packages/core/src/tools/utils.spec.ts | 2 +- packages/core/src/tools/utils.ts | 6 +- packages/core/test/capturedExceptions.ts | 11 +- .../rum-core/src/boot/rumPublicApi.spec.ts | 4 +- .../src/browser/domMutationCollection.spec.ts | 2 +- .../src/domain/requestCollection.spec.ts | 2 +- .../action/getActionNameFromElement.spec.ts | 4 +- .../action/getActionNameFromElement.ts | 4 +- .../src/domain/tracing/getDocumentTraceId.ts | 2 +- .../src/domain/tracing/tracer.spec.ts | 2 +- .../rum-core/src/domain/tracing/tracer.ts | 4 +- packages/rum-core/src/rumEvent.types.ts | 2 +- .../rum-recorder/src/domain/rrweb/mutation.ts | 2 +- .../rum-recorder/src/domain/rrweb/observer.ts | 10 +- .../rum-recorder/src/domain/rrweb/record.ts | 4 +- .../rum-recorder/src/domain/rrweb/types.ts | 2 +- .../rum-recorder/src/domain/rrweb/utils.ts | 4 +- scripts/bs-wrapper.js | 1 + scripts/cli | 2 +- test/e2e/tsconfig.json | 5 - test/e2e/wdio.base.conf.js | 4 +- tsconfig.eslint.json | 4 + tslint.json | 34 - yarn.lock | 1332 ++++++++++++++--- 37 files changed, 1449 insertions(+), 301 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 tsconfig.eslint.json delete mode 100644 tslint.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..22664df6c7 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +bundle +cjs +esm \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..ced4dffa03 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,237 @@ +module.exports = { + env: { + browser: true, + }, + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'prettier', + 'prettier/@typescript-eslint', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.eslint.json', + sourceType: 'module', + }, + plugins: [ + 'eslint-plugin-unicorn', + 'eslint-plugin-import', + 'eslint-plugin-no-null', + 'eslint-plugin-jsdoc', + 'eslint-plugin-prefer-arrow', + 'eslint-plugin-react', + '@typescript-eslint', + ], + rules: { + 'no-shadow': 0, + 'import/order': 0, + 'no-redeclare': 0, + 'no-null/no-null': 0, + 'arrow-body-style': 0, + 'no-throw-literal': 0, + 'prefer-rest-params': 0, + 'no-underscore-dangle': 0, + 'unicorn/filename-case': 0, + 'jsdoc/check-indentation': 0, + '@typescript-eslint/indent': 0, + 'import/no-internal-modules': 0, + '@typescript-eslint/array-type': 0, + '@typescript-eslint/dot-notation': 0, + 'jsdoc/newline-after-description': 0, + '@typescript-eslint/no-extra-semi': 0, + '@typescript-eslint/require-await': 0, + '@typescript-eslint/await-thenable': 0, + '@typescript-eslint/ban-ts-comment': 0, + '@typescript-eslint/no-unused-vars': 0, + '@typescript-eslint/no-unsafe-call': 0, + 'import/no-extraneous-dependencies': 0, + '@typescript-eslint/unbound-method': 0, + '@typescript-eslint/member-ordering': 0, + '@typescript-eslint/no-for-in-array': 0, + '@typescript-eslint/no-var-requires': 0, + '@typescript-eslint/no-unsafe-return': 0, + '@typescript-eslint/naming-convention': 0, + '@typescript-eslint/no-empty-interface': 0, + '@typescript-eslint/prefer-regexp-exec': 0, + '@typescript-eslint/no-inferrable-types': 0, + '@typescript-eslint/no-floating-promises': 0, + '@typescript-eslint/no-unsafe-assignment': 0, + '@typescript-eslint/no-non-null-assertion': 0, + '@typescript-eslint/promise-function-async': 0, + '@typescript-eslint/restrict-plus-operands': 0, + '@typescript-eslint/no-unsafe-member-access': 0, + '@typescript-eslint/restrict-template-expressions': 0, + '@typescript-eslint/no-unnecessary-type-assertion': 0, + '@typescript-eslint/explicit-module-boundary-types': 0, + '@typescript-eslint/ban-types': [ + 0, + { + types: { + Object: { + message: 'Avoid using the `Object` type. Did you mean `object`?', + }, + Function: { + message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', + }, + // eslint-disable-next-line id-blacklist + Boolean: { + message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', + }, + // eslint-disable-next-line id-blacklist + Number: { + message: 'Avoid using the `Number` type. Did you mean `number`?', + }, + // eslint-disable-next-line id-blacklist + String: { + message: 'Avoid using the `String` type. Did you mean `string`?', + }, + Symbol: { + message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', + }, + }, + }, + ], + + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/explicit-member-accessibility': [ + 'off', + { + accessibility: 'explicit', + }, + ], + '@typescript-eslint/member-delimiter-style': [ + 'off', + { + multiline: { + delimiter: 'none', + requireLast: true, + }, + singleline: { + delimiter: 'semi', + requireLast: false, + }, + }, + ], + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-parameter-properties': 'off', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + + '@typescript-eslint/no-unused-expressions': 'error', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/quotes': 'off', + '@typescript-eslint/semi': ['off', null], + '@typescript-eslint/triple-slash-reference': [ + 'error', + { + path: 'always', + types: 'prefer-import', + lib: 'always', + }, + ], + '@typescript-eslint/type-annotation-spacing': 'off', + '@typescript-eslint/unified-signatures': 'error', + 'arrow-parens': ['off', 'always'], + 'brace-style': ['off', 'off'], + 'comma-dangle': 'off', + complexity: 'off', + 'constructor-super': 'error', + curly: 'error', + 'eol-last': 'off', + eqeqeq: ['error', 'smart'], + 'guard-for-in': 'error', + 'id-blacklist': [ + 'error', + 'any', + 'Number', + 'number', + 'String', + 'string', + 'Boolean', + 'boolean', + 'Undefined', + 'undefined', + ], + 'id-match': 'error', + 'import/no-default-export': 'error', + 'jsdoc/check-alignment': 'error', + 'linebreak-style': 'off', + 'max-classes-per-file': 'off', + 'max-len': [ + 'error', + { + code: 120, + }, + ], + 'new-parens': 'off', + 'newline-per-chained-call': 'off', + 'no-array-constructor': 'off', + 'no-bitwise': 'error', + 'no-caller': 'error', + 'no-cond-assign': 'error', + 'no-console': 'off', + 'no-debugger': 'error', + 'no-duplicate-case': 'error', + 'no-duplicate-imports': 'error', + 'no-else-return': 'error', + 'no-empty': 'error', + 'no-empty-function': 'off', + 'no-eval': 'error', + 'no-extra-bind': 'error', + 'no-extra-semi': 'off', + 'no-fallthrough': 'off', + 'no-implied-eval': 'off', + 'no-invalid-this': 'off', + 'no-irregular-whitespace': 'off', + 'no-multiple-empty-lines': 'off', + 'no-new-func': 'error', + 'no-new-wrappers': 'error', + 'no-param-reassign': 'error', + 'no-return-await': 'error', + 'no-sequences': 'error', + 'no-sparse-arrays': 'error', + 'no-template-curly-in-string': 'error', + 'no-trailing-spaces': 'off', + 'no-undef-init': 'error', + 'no-unsafe-finally': 'error', + 'no-unused-labels': 'error', + 'no-unused-vars': 'off', + 'no-var': 'error', + 'object-shorthand': 'error', + 'one-var': ['error', 'never'], + 'prefer-const': 'error', + 'prefer-object-spread': 'error', + 'prefer-template': 'error', + 'quote-props': 'off', + radix: 'error', + 'react/jsx-curly-spacing': 'off', + 'react/jsx-equals-spacing': 'off', + 'react/jsx-wrap-multilines': 'off', + 'require-await': 'off', + 'space-before-function-paren': 'off', + 'space-in-parens': ['off', 'never'], + 'spaced-comment': [ + 'error', + 'always', + { + markers: ['/'], + }, + ], + 'use-isnan': 'error', + 'valid-typeof': 'off', + }, +} diff --git a/package.json b/package.json index 63f62526d7..1d568c3b4c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "lerna run build --stream", "build:bundle": "lerna run build:bundle --stream", "format": "prettier --check .", - "lint": "scripts/cli lint . && scripts/cli lint test/e2e", + "lint": "scripts/cli lint .", "typecheck": "scripts/cli typecheck . && scripts/cli typecheck test/e2e", "dev": "node scripts/dev-server.js", "release": "lerna version --exact", @@ -31,6 +31,8 @@ "@types/express": "4.17.8", "@types/jasmine": "3.5.10", "@types/sinon": "9.0.10", + "@typescript-eslint/eslint-plugin": "4.12.0", + "@typescript-eslint/parser": "4.12.0", "@wdio/browserstack-service": "6.1.4", "@wdio/cli": "6.1.4", "@wdio/jasmine-framework": "6.1.3", @@ -44,6 +46,14 @@ "codecov": "3.7.1", "cors": "2.8.5", "emoji-name-map": "1.2.8", + "eslint": "7.17.0", + "eslint-config-prettier": "7.1.0", + "eslint-plugin-import": "2.22.1", + "eslint-plugin-jsdoc": "30.7.13", + "eslint-plugin-no-null": "1.0.2", + "eslint-plugin-prefer-arrow": "1.2.2", + "eslint-plugin-react": "7.22.0", + "eslint-plugin-unicorn": "25.0.1", "express": "4.17.1", "istanbul-instrumenter-loader": "3.0.1", "jasmine-core": "3.5.0", @@ -67,12 +77,7 @@ "ts-loader": "6.2.2", "ts-node": "8.8.1", "tsconfig-paths-webpack-plugin": "3.2.0", - "tslint": "5.18.0", - "tslint-config-airbnb": "5.11.1", - "tslint-config-prettier": "1.18.0", - "tslint-eslint-rules": "5.4.0", "typescript": "3.8.3", - "typescript-tslint-plugin": "0.5.4", "webdriverio": "6.1.4", "webpack": "4.42.1", "webpack-cli": "3.3.11", diff --git a/packages/core/src/browser/fetchProxy.ts b/packages/core/src/browser/fetchProxy.ts index 6c90e99b9f..65379adf66 100644 --- a/packages/core/src/browser/fetchProxy.ts +++ b/packages/core/src/browser/fetchProxy.ts @@ -69,7 +69,7 @@ function proxyFetch() { originalFetch = window.fetch - // tslint:disable promise-function-async + // eslint-disable @typescript-eslint/promise-function-async window.fetch = monitor(function (this: WindowOrWorkerGlobalScope['fetch'], input: RequestInfo, init?: RequestInit) { const method = (init && init.method) || (typeof input === 'object' && input.method) || 'GET' const url = normalizeUrl((typeof input === 'object' && input.url) || (input as string)) diff --git a/packages/core/src/domain/internalMonitoring.spec.ts b/packages/core/src/domain/internalMonitoring.spec.ts index 8a0aba84fd..9035357da7 100644 --- a/packages/core/src/domain/internalMonitoring.spec.ts +++ b/packages/core/src/domain/internalMonitoring.spec.ts @@ -32,7 +32,7 @@ describe('internal monitoring', () => { @monitored monitoredStringErrorThrowing() { - // tslint:disable-next-line: no-string-throw + // eslint-disable-next-line no-throw-literal throw 'string error' } diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index 9405b7d51c..76a4b0845e 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -1,4 +1,4 @@ -// tslint:disable ban-types +// eslint-disable @typescript-eslint/ban-types import { combine, Context } from '../tools/context' import { toStackTraceString } from '../tools/error' import * as utils from '../tools/utils' diff --git a/packages/core/src/domain/tracekit.spec.ts b/packages/core/src/domain/tracekit.spec.ts index ffb56b37b0..a6bf569de5 100644 --- a/packages/core/src/domain/tracekit.spec.ts +++ b/packages/core/src/domain/tracekit.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable no-unsafe-any +// eslint-disable import { computeStackTrace, Handler, report } from './tracekit' @@ -112,7 +112,7 @@ Error: foo expect(computeStackTrace(2).message).toBeUndefined() expect(computeStackTrace({ foo: 'bar' }).message).toBeUndefined() expect(computeStackTrace(undefined).message).toBeUndefined() - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null expect(computeStackTrace(null).message).toBeUndefined() }) }) diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 9bb6bbcdec..f6d73cfcd4 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -1,4 +1,4 @@ -// tslint:disable no-unsafe-any +// eslint-disable import { monitor } from './internalMonitoring' @@ -53,7 +53,7 @@ export interface StackTrace { const UNKNOWN_FUNCTION = '?' // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types -// tslint:disable-next-line max-line-length +// eslint-disable-next-line max-len const ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/ /** @@ -87,7 +87,7 @@ function isUndefined(what: any) { * @return {Function} The wrapped func * @memberof TraceKit */ -// tslint:disable-next-line ban-types +// eslint-disable-next-line @typescript-eslint/ban-types export function wrap(func: Function) { function wrapped(this: any) { try { @@ -499,11 +499,11 @@ export const computeStackTrace = (function computeStackTraceWrapper() { return } - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len const chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len const gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len const winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i // Used to additionally parse URL/line/column from eval frames @@ -605,7 +605,7 @@ export const computeStackTrace = (function computeStackTraceWrapper() { } const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len const opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i const lines = stacktrace.split('\n') const stack = [] diff --git a/packages/core/src/domain/tracekitHandler.spec.ts b/packages/core/src/domain/tracekitHandler.spec.ts index cd08646237..fb2df76b3a 100644 --- a/packages/core/src/domain/tracekitHandler.spec.ts +++ b/packages/core/src/domain/tracekitHandler.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable no-unsafe-any +// eslint-disable import { report, StackFrame, wrap } from './tracekit' diff --git a/packages/core/src/domain/tracekitParser.spec.ts b/packages/core/src/domain/tracekitParser.spec.ts index 2df9903625..58b72af54a 100644 --- a/packages/core/src/domain/tracekitParser.spec.ts +++ b/packages/core/src/domain/tracekitParser.spec.ts @@ -1,4 +1,4 @@ -// tslint:disable no-unsafe-any +// eslint-disable import * as CapturedExceptions from '../../test/capturedExceptions' import { isSafari } from '../tools/specHelper' @@ -1120,7 +1120,7 @@ describe('Parser', () => { func: 'this', line: 74, url: - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js', }) }) diff --git a/packages/core/src/tools/context.spec.ts b/packages/core/src/tools/context.spec.ts index 05e666b96f..8a3ae0c282 100644 --- a/packages/core/src/tools/context.spec.ts +++ b/packages/core/src/tools/context.spec.ts @@ -20,12 +20,12 @@ describe('context', () => { }) it('should replace a sub-value with null', () => { - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null expect(combine({ a: {} }, { a: null as any })).toEqual({ a: null }) }) it('should ignore null arguments', () => { - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null expect(combine({ a: 1 }, null)).toEqual({ a: 1 }) }) @@ -169,13 +169,13 @@ describe('context', () => { withSnakeCaseKeys({ camelCase: 1, nestedKey: { 'kebab-case': 'helloWorld', array: [{ camelCase: 1 }, { camelCase: 2 }] }, - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null nullValue: null, }) ).toEqual({ camel_case: 1, nested_key: { kebab_case: 'helloWorld', array: [{ camel_case: 1 }, { camel_case: 2 }] }, - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null null_value: null, }) }) diff --git a/packages/core/src/tools/limitModification.spec.ts b/packages/core/src/tools/limitModification.spec.ts index a2db325eb4..d5897c3560 100644 --- a/packages/core/src/tools/limitModification.spec.ts +++ b/packages/core/src/tools/limitModification.spec.ts @@ -1,6 +1,6 @@ import { limitModification } from './limitModification' -// tslint:disable: no-unsafe-any +/* eslint-disable */ describe('limitModification', () => { it('should allow modifications on modifiable field', () => { const object = { foo: { bar: 'bar' }, qux: 'qux' } diff --git a/packages/core/src/tools/specHelper.ts b/packages/core/src/tools/specHelper.ts index e51d760a6c..71479a79a1 100644 --- a/packages/core/src/tools/specHelper.ts +++ b/packages/core/src/tools/specHelper.ts @@ -122,10 +122,10 @@ class StubXhr { this.fakeEventTarget = document.createElement('div') } - // tslint:disable:no-empty + /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ open(method: string, url: string) {} send() {} - // tslint:enable:no-empty + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ abort() { this.status = 0 diff --git a/packages/core/src/tools/utils.spec.ts b/packages/core/src/tools/utils.spec.ts index 9cf26f9ed8..1d4a73c1b9 100644 --- a/packages/core/src/tools/utils.spec.ts +++ b/packages/core/src/tools/utils.spec.ts @@ -245,7 +245,7 @@ describe('utils', () => { it('should jsonStringify edge cases', () => { expect(jsonStringify(undefined)).toEqual(undefined) - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null expect(jsonStringify(null)).toEqual('null') expect(jsonStringify(1)).toEqual('1') expect(jsonStringify(true)).toEqual('true') diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 145899aa77..03d95a7347 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -101,7 +101,7 @@ export function assign(target: Assignable, ...toAssign: Assignable[]) { */ export function generateUUID(placeholder?: string): string { return placeholder - ? // tslint:disable-next-line no-bitwise + ? // eslint-disable-next-line no-bitwise (parseInt(placeholder, 10) ^ ((Math.random() * 16) >> (parseInt(placeholder, 10) / 4))).toString(16) : `${1e7}-${1e3}-${4e3}-${8e3}-${1e11}`.replace(/[018]/g, generateUUID) } @@ -125,7 +125,7 @@ export function msToNs(duration: number | T): number | T { return round(duration * 1e6, 0) } -// tslint:disable-next-line:no-empty +// eslint-disable-next-line no-empty,@typescript-eslint/no-empty-function export function noop() {} interface ObjectWithToJSON { @@ -188,7 +188,7 @@ function hasToJSON(value: unknown): value is ObjectWithToJSON { export function includes(candidate: string, search: string): boolean export function includes(candidate: T[], search: T): boolean export function includes(candidate: string | unknown[], search: any) { - // tslint:disable-next-line: no-unsafe-any + // eslint-disable-next-line return candidate.indexOf(search) !== -1 } diff --git a/packages/core/test/capturedExceptions.ts b/packages/core/test/capturedExceptions.ts index 553a001fb3..f1fc503a85 100644 --- a/packages/core/test/capturedExceptions.ts +++ b/packages/core/test/capturedExceptions.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ export const OPERA_854 = { message: `Statement on line 44: Type mismatch (usually a non-object value used where an object is required) Backtrace: @@ -323,7 +324,7 @@ export const IE_9 = { export const IE_10 = { description: "Unable to get property 'undef' of undefined or null reference", message: "Unable to get property 'undef' of undefined or null reference", - number: -2146823281, + number: -2146823281, // eslint-disable-line id-blacklist stack: `TypeError: Unable to get property 'undef' of undefined or null reference at Anonymous function (http://path/to/file.js:48:13) at foo (http://path/to/file.js:46:9) @@ -334,7 +335,7 @@ export const IE_11 = { description: "Unable to get property 'undef' of undefined or null reference", message: "Unable to get property 'undef' of undefined or null reference", name: 'TypeError', - number: -2146823281, + number: -2146823281, // eslint-disable-line id-blacklist stack: `TypeError: Unable to get property 'undef' of undefined or null reference at Anonymous function (http://path/to/file.js:47:21) at foo (http://path/to/file.js:45:13) @@ -345,7 +346,7 @@ export const IE_11_EVAL = { description: "'getExceptionProps' is undefined", message: "'getExceptionProps' is undefined", name: 'ReferenceError', - number: -2146823279, + number: -2146823279, // eslint-disable-line id-blacklist stack: `ReferenceError: 'getExceptionProps' is undefined at eval code (eval code:1:1) at foo (http://path/to/file.js:58:17) @@ -383,7 +384,7 @@ export const PHANTOMJS_1_19 = { at http://path/to/file.js:4287`, } -// tslint:disable max-line-length +// eslint-disable max-len export const ANDROID_REACT_NATIVE = { message: 'Error: test', name: 'Error', @@ -397,7 +398,7 @@ at child(/home/username/sample-workspace/sampleapp.collect.react/node_modules/re at children(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10) at this(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)\n`, } -// tslint:enable max-line-length +// eslint-enable max-len export const ANDROID_REACT_NATIVE_PROD = { message: 'Error: test', diff --git a/packages/rum-core/src/boot/rumPublicApi.spec.ts b/packages/rum-core/src/boot/rumPublicApi.spec.ts index 1daba0bb5f..be70de2cc8 100644 --- a/packages/rum-core/src/boot/rumPublicApi.spec.ts +++ b/packages/rum-core/src/boot/rumPublicApi.spec.ts @@ -367,7 +367,7 @@ describe('rum entry', () => { }) it('should sanitize predefined properties', () => { - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null const user = { id: null, name: 2, email: { bar: 'qux' } } publicApi.setUser(user as any) publicApi.addAction('message') @@ -384,7 +384,7 @@ describe('rum entry', () => { it('should reject non object input', () => { publicApi.setUser(2 as any) - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null publicApi.setUser(null as any) publicApi.setUser(undefined as any) expect(errorSpy).toHaveBeenCalledTimes(3) diff --git a/packages/rum-core/src/browser/domMutationCollection.spec.ts b/packages/rum-core/src/browser/domMutationCollection.spec.ts index 212869dfbe..c8bedd926f 100644 --- a/packages/rum-core/src/browser/domMutationCollection.spec.ts +++ b/packages/rum-core/src/browser/domMutationCollection.spec.ts @@ -95,7 +95,7 @@ describe('domMutationCollection', () => { 'collects DOM mutation when an element is moved', domMutationSpec( (root) => { - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null root.insertBefore(root.childNodes[0], null) }, { expectedMutations: 1 } diff --git a/packages/rum-core/src/domain/requestCollection.spec.ts b/packages/rum-core/src/domain/requestCollection.spec.ts index 1fcddfbfc8..019fc80734 100644 --- a/packages/rum-core/src/domain/requestCollection.spec.ts +++ b/packages/rum-core/src/domain/requestCollection.spec.ts @@ -57,7 +57,7 @@ describe('collect fetch', () => { afterEach(() => { fetchStubManager.reset() resetFetchProxy() - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null window.onunhandledrejection = null }) diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.spec.ts index 26fff0c17f..caf63f0408 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.spec.ts @@ -58,11 +58,11 @@ describe('getActionNameFromElement', () => { it('limits the name length to a reasonable size', () => { expect( getActionNameFromElement( - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len element`
Foooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
` ) ).toBe( - // tslint:disable-next-line max-line-length + // eslint-disable-next-line max-len 'Foooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [...]' ) }) diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts index 4a55a8a1f9..22ff62f159 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts @@ -154,7 +154,7 @@ function truncate(s: string) { function getElementById(refElement: Element, id: string) { // Use the element ownerDocument here, because tests are executed in an iframe, so // document.getElementById won't work. - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null return refElement.ownerDocument ? refElement.ownerDocument.getElementById(id) : null } @@ -169,7 +169,7 @@ function getTextualContent(element: Element | HTMLElement) { // remove the inner text of SCRIPT and STYLES from the result. This is a bit dirty, but should // be relatively fast and work in most cases. const elementsTextToRemove: NodeListOf = element.querySelectorAll('script, style') - // tslint:disable-next-line: prefer-for-of + // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let i = 0; i < elementsTextToRemove.length; i += 1) { const innerText = elementsTextToRemove[i].innerText if (innerText.trim().length > 0) { diff --git a/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts b/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts index 3df4a57199..ae31188a80 100644 --- a/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts +++ b/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts @@ -53,7 +53,7 @@ export function findTraceComment(document: Document): string | undefined { // 1. Try to find the comment as a direct child of the document // Note: TSLint advises to use a 'for of', but TS doesn't allow to use 'for of' if the iterated // value is not an array or string (here, a NodeList). - // tslint:disable-next-line: prefer-for-of + // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let i = 0; i < document.childNodes.length; i += 1) { const comment = getTraceCommentFromNode(document.childNodes[i]) if (comment) { diff --git a/packages/rum-core/src/domain/tracing/tracer.spec.ts b/packages/rum-core/src/domain/tracing/tracer.spec.ts index 0608b9d6f0..fa80b23286 100644 --- a/packages/rum-core/src/domain/tracing/tracer.spec.ts +++ b/packages/rum-core/src/domain/tracing/tracer.spec.ts @@ -41,7 +41,7 @@ describe('tracer', () => { setRequestHeader(this: XhrStub, name: string, value: string) { this.headers[name] = value }, - // tslint:disable-next-line: no-object-literal-type-assertion + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions headers: {} as XhrStub['headers'], } }) diff --git a/packages/rum-core/src/domain/tracing/tracer.ts b/packages/rum-core/src/domain/tracing/tracer.ts index 60e4f0a6b3..d97f159389 100644 --- a/packages/rum-core/src/domain/tracing/tracer.ts +++ b/packages/rum-core/src/domain/tracing/tracer.ts @@ -96,7 +96,7 @@ function makeTracingHeaders(traceId: TraceIdentifier, spanId: TraceIdentifier): } } -/* tslint:disable:no-bitwise */ +/* eslint-disable no-bitwise */ export class TraceIdentifier { private buffer: Uint8Array = new Uint8Array(8) @@ -141,4 +141,4 @@ export class TraceIdentifier { ) } } -/* tslint:enable:no-bitwise */ +/* eslint-enable no-bitwise */ diff --git a/packages/rum-core/src/rumEvent.types.ts b/packages/rum-core/src/rumEvent.types.ts index 562fd1e041..ac4db8264e 100644 --- a/packages/rum-core/src/rumEvent.types.ts +++ b/packages/rum-core/src/rumEvent.types.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ /** * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead. */ diff --git a/packages/rum-recorder/src/domain/rrweb/mutation.ts b/packages/rum-recorder/src/domain/rrweb/mutation.ts index 45942b0c8e..b4b61bb213 100644 --- a/packages/rum-recorder/src/domain/rrweb/mutation.ts +++ b/packages/rum-recorder/src/domain/rrweb/mutation.ts @@ -1,4 +1,4 @@ -/* tslint:disable:no-null-keyword */ +/* eslint-disable no-null/no-null */ import { IGNORED_NODE, INode, diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index 1b0ea4c6c0..b582bac9ba 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -1,6 +1,6 @@ -/* tslint:disable:no-null-keyword */ +/* eslint-disable no-null/no-null */ import { noop } from '@datadog/browser-core' -// tslint:disable-next-line: no-implicit-dependencies +// eslint-disable-next-line import/no-extraneous-dependencies import { FontFaceDescriptors, FontFaceSet } from 'css-font-loading-module' import { INode, MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot' import { MutationBuffer } from './mutation' @@ -386,7 +386,7 @@ function initFontObserver(cb: FontCallback): ListenerHandler { const fontMap = new WeakMap() const originalFontFace = FontFace - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any ;(window as any).FontFace = function FontFace( family: string, source: string | ArrayBufferView, @@ -400,7 +400,7 @@ function initFontObserver(cb: FontCallback): ListenerHandler { fontSource: typeof source === 'string' ? source - : // tslint:disable-next-line: no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any JSON.stringify(Array.from(new Uint8Array(source as any))), }) return fontFace @@ -420,7 +420,7 @@ function initFontObserver(cb: FontCallback): ListenerHandler { }) handlers.push(() => { - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any ;(window as any).FonFace = originalFontFace }) handlers.push(restoreHandler) diff --git a/packages/rum-recorder/src/domain/rrweb/record.ts b/packages/rum-recorder/src/domain/rrweb/record.ts index e8b5fe77e9..c263e4b380 100644 --- a/packages/rum-recorder/src/domain/rrweb/record.ts +++ b/packages/rum-recorder/src/domain/rrweb/record.ts @@ -1,4 +1,4 @@ -/* tslint:disable:no-null-keyword */ +/* eslint-disable no-null/no-null */ import { MaskInputOptions, SlimDOMOptions, snapshot } from 'rrweb-snapshot' import { initObservers, mutationBuffer } from './observer' import { Event, EventType, EventWithTime, IncrementalSource, ListenerHandler, RecordOptions } from './types' @@ -50,7 +50,7 @@ function record(options: RecordOptions = {}): ListenerHand 'datetime-local': true, email: true, month: true, - number: true, + number: true, // eslint-disable-line id-blacklist range: true, search: true, select: true, diff --git a/packages/rum-recorder/src/domain/rrweb/types.ts b/packages/rum-recorder/src/domain/rrweb/types.ts index 5332ce1028..c6e96763bb 100644 --- a/packages/rum-recorder/src/domain/rrweb/types.ts +++ b/packages/rum-recorder/src/domain/rrweb/types.ts @@ -1,4 +1,4 @@ -// tslint:disable-next-line: no-implicit-dependencies +// eslint-disable-next-line import/no-extraneous-dependencies import { FontFaceDescriptors } from 'css-font-loading-module' import { idNodeMap, INode, MaskInputOptions, serializedNodeWithId, SlimDOMOptions } from 'rrweb-snapshot' diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index e95e111b2e..05d58ca0c2 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -18,7 +18,7 @@ export const mirror: Mirror = { return n.__sn.id }, getNode(id) { - // tslint:disable-next-line: no-null-keyword + // eslint-disable-next-line no-null/no-null return mirror.map[id] || null }, // TODO: use a weakmap to get rid of manually memory management @@ -84,7 +84,7 @@ export function hookSetter( } } -// tslint:disable-next-line: max-line-length +// eslint-disable-next-line max-len // copy from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts export function patch( source: { [key: string]: any }, diff --git a/scripts/bs-wrapper.js b/scripts/bs-wrapper.js index c4d59644b4..b647cfef19 100644 --- a/scripts/bs-wrapper.js +++ b/scripts/bs-wrapper.js @@ -4,6 +4,7 @@ const exec = require('child_process').exec const request = require('request') const AVAILABILITY_CHECK_DELAY = 30_000 +// eslint-disable-next-line max-len const RUNNING_BUILDS_API = `https://${process.env.BS_USERNAME}:${process.env.BS_ACCESS_KEY}@api.browserstack.com/automate/builds.json?status=running` const COMMAND = process.argv.slice(2).join(' ') const RETRY_DELAY = 30_000 diff --git a/scripts/cli b/scripts/cli index 5dd03b14fc..1d35d6b6a9 100755 --- a/scripts/cli +++ b/scripts/cli @@ -28,7 +28,7 @@ cmd_typecheck () { cmd_lint () { local project_path="${1}" - tslint -p "$project_path" -c ./tslint.json + eslint "$project_path" } cmd_update_submodule () { diff --git a/test/e2e/tsconfig.json b/test/e2e/tsconfig.json index 627c4c06c4..23767ccb72 100644 --- a/test/e2e/tsconfig.json +++ b/test/e2e/tsconfig.json @@ -6,11 +6,6 @@ "esModuleInterop": true, "resolveJsonModule": true, "target": "es5", - "plugins": [ - { - "name": "typescript-tslint-plugin" - } - ], "types": ["node", "webdriverio", "jasmine", "ajv"], "paths": { "@datadog/browser-logs": ["../../packages/logs/src"], diff --git a/test/e2e/wdio.base.conf.js b/test/e2e/wdio.base.conf.js index 03237036d8..28addd4ee9 100644 --- a/test/e2e/wdio.base.conf.js +++ b/test/e2e/wdio.base.conf.js @@ -11,7 +11,7 @@ if (testReportDirectory) { 'junit', { outputDir: testReportDirectory, - outputFileFormat: function (options) { + outputFileFormat(options) { return `results-${options.cid}.${options.capabilities.browserName}.xml` }, }, @@ -35,7 +35,7 @@ module.exports = { defaultTimeoutInterval: 60000, requires: [path.resolve(__dirname, './ts-node')], }, - onPrepare: function () { + onPrepare() { if (testReportDirectory) { try { mkdirSync(testReportDirectory, { recursive: true }) diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000000..ce89aba829 --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["./.eslintrc.js", "./**/*.js", "./*.js", "./**/*.ts"] +} \ No newline at end of file diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 6d077d1696..0000000000 --- a/tslint.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint-config-airbnb", - "tslint:recommended", - "tslint:latest", - "tslint-eslint-rules", - "tslint-config-prettier" - ], - "jsRules": {}, - "rules": { - "file-name-casing": [true, "camel-case"], - "indent": [true, "spaces", 2], - "interface-name": [true, "never-prefix"], - "max-classes-per-file": false, - "max-line-length": [true, 120], - "member-access": false, - "no-console": false, - "no-default-export": true, - "no-implicit-dependencies": [ - true, - "dev", - ["@datadog/browser-logs", "@datadog/browser-rum", "@datadog/browser-rum-recorder", "@datadog/browser-core"] - ], - "no-null-keyword": true, - "no-submodule-imports": [true], - "no-unsafe-any": true, - "object-literal-sort-keys": [true, "shorthand-first"], - "prefer-array-literal": [true, { "allow-type-parameters": true }], - "promise-function-async": true, - "ter-computed-property-spacing": false - }, - "rulesDirectory": [] -} diff --git a/yarn.lock b/yarn.lock index b484c5009c..2c5fac54e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,6 +18,13 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + "@babel/code-frame@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" @@ -25,6 +32,15 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/generator@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" + integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== + dependencies: + "@babel/types" "^7.12.11" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/generator@^7.4.0", "@babel/generator@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.5.tgz#873a7f936a3c89491b43536d12245b626664e3cf" @@ -45,6 +61,15 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-function-name@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz#1fd7738aee5dcf53c3ecff24f1da9c511ec47b42" + integrity sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.10" + "@babel/template" "^7.12.7" + "@babel/types" "^7.12.11" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -52,6 +77,20 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-get-function-arity@^7.12.10": + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" + integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== + dependencies: + "@babel/types" "^7.12.10" + +"@babel/helper-split-export-declaration@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz#1b4cc424458643c47d37022223da33d76ea4603a" + integrity sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g== + dependencies: + "@babel/types" "^7.12.11" + "@babel/helper-split-export-declaration@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" @@ -59,6 +98,11 @@ dependencies: "@babel/types" "^7.4.4" +"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + "@babel/highlight@^7.0.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" @@ -68,6 +112,20 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.7.0": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" + integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== + "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" @@ -82,6 +140,15 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/template@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" + integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.12.7" + "@babel/types" "^7.12.7" + "@babel/traverse@^7.4.3": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" @@ -97,6 +164,21 @@ globals "^11.1.0" lodash "^4.17.13" +"@babel/traverse@^7.7.0": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.12.tgz#d0cd87892704edd8da002d674bc811ce64743376" + integrity sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w== + dependencies: + "@babel/code-frame" "^7.12.11" + "@babel/generator" "^7.12.11" + "@babel/helper-function-name" "^7.12.11" + "@babel/helper-split-export-declaration" "^7.12.11" + "@babel/parser" "^7.12.11" + "@babel/types" "^7.12.12" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + "@babel/types@^7.0.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.5.tgz#97b9f728e182785909aa4ab56264f090a028d18a" @@ -106,6 +188,31 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.12", "@babel/types@^7.12.7", "@babel/types@^7.7.0": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" + integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + +"@eslint/eslintrc@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" + integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + lodash "^4.17.19" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845" @@ -180,25 +287,6 @@ unique-filename "^1.1.1" which "^1.3.1" -"@fimbul/bifrost@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@fimbul/bifrost/-/bifrost-0.17.0.tgz#f0383ba7e40992e3193dc87e2ddfde2ad62a9cf4" - integrity sha512-gVTkJAOef5HtN6LPmrtt5fAUmBywwlgmObsU3FBhPoNeXPLaIl2zywXkJEtvvVLQnaFmtff3x+wIj5lHRCDE3Q== - dependencies: - "@fimbul/ymir" "^0.17.0" - get-caller-file "^2.0.0" - tslib "^1.8.1" - tsutils "^3.5.0" - -"@fimbul/ymir@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@fimbul/ymir/-/ymir-0.17.0.tgz#4f28389b9f804d1cd202e11983af1743488b7815" - integrity sha512-xMXM9KTXRLHLVS6dnX1JhHNEkmWHcAVCQ/4+DA1KKwC/AFnGHzu/7QfQttEPgw3xplT+ILf9e3i64jrFwB3JtA== - dependencies: - inversify "^5.0.0" - reflect-metadata "^0.1.12" - tslib "^1.8.1" - "@jest/types@^25.3.0": version "25.3.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.3.0.tgz#88f94b277a1d028fd7117bc1f74451e0fc2131e7" @@ -907,11 +995,32 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" +"@nodelib/fs.scandir@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" + integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== + dependencies: + "@nodelib/fs.stat" "2.0.4" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" + integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== + "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@nodelib/fs.walk@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" + integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + dependencies: + "@nodelib/fs.scandir" "2.1.4" + fastq "^1.6.0" + "@octokit/endpoint@^5.1.0": version "5.4.1" resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.4.1.tgz#8f4c747d6cf8f352683d35a7fe8664db487cb730" @@ -1137,7 +1246,7 @@ resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.5.10.tgz#a1a41012012b5da9d4b205ba9eba58f6cce2ab7b" integrity sha512-3F8qpwBAiVc5+HPJeXJpbrl+XjawGmciN5LgiO7Gv1pl1RHtjoMNqZpqEksaPJW05ViKe8snYInRs6xB25Xdew== -"@types/json-schema@^7.0.6": +"@types/json-schema@^7.0.3", "@types/json-schema@^7.0.6": version "7.0.6" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== @@ -1252,6 +1361,76 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.12.0.tgz#00d1b23b40b58031e6d7c04a5bc6c1a30a2e834a" + integrity sha512-wHKj6q8s70sO5i39H2g1gtpCXCvjVszzj6FFygneNFyIAxRvNSVz9GML7XpqrB9t7hNutXw+MHnLN/Ih6uyB8Q== + dependencies: + "@typescript-eslint/experimental-utils" "4.12.0" + "@typescript-eslint/scope-manager" "4.12.0" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.12.0.tgz#372838e76db76c9a56959217b768a19f7129546b" + integrity sha512-MpXZXUAvHt99c9ScXijx7i061o5HEjXltO+sbYfZAAHxv3XankQkPaNi5myy0Yh0Tyea3Hdq1pi7Vsh0GJb0fA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/scope-manager" "4.12.0" + "@typescript-eslint/types" "4.12.0" + "@typescript-eslint/typescript-estree" "4.12.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.12.0.tgz#e1cf30436e4f916c31fcc962158917bd9e9d460a" + integrity sha512-9XxVADAo9vlfjfoxnjboBTxYOiNY93/QuvcPgsiKvHxW6tOZx1W4TvkIQ2jB3k5M0pbFP5FlXihLK49TjZXhuQ== + dependencies: + "@typescript-eslint/scope-manager" "4.12.0" + "@typescript-eslint/types" "4.12.0" + "@typescript-eslint/typescript-estree" "4.12.0" + debug "^4.1.1" + +"@typescript-eslint/scope-manager@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.12.0.tgz#beeb8beca895a07b10c593185a5612f1085ef279" + integrity sha512-QVf9oCSVLte/8jvOsxmgBdOaoe2J0wtEmBr13Yz0rkBNkl5D8bfnf6G4Vhox9qqMIoG7QQoVwd2eG9DM/ge4Qg== + dependencies: + "@typescript-eslint/types" "4.12.0" + "@typescript-eslint/visitor-keys" "4.12.0" + +"@typescript-eslint/types@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.12.0.tgz#fb891fe7ccc9ea8b2bbd2780e36da45d0dc055e5" + integrity sha512-N2RhGeheVLGtyy+CxRmxdsniB7sMSCfsnbh8K/+RUIXYYq3Ub5+sukRCjVE80QerrUBvuEvs4fDhz5AW/pcL6g== + +"@typescript-eslint/typescript-estree@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.12.0.tgz#3963418c850f564bdab3882ae23795d115d6d32e" + integrity sha512-gZkFcmmp/CnzqD2RKMich2/FjBTsYopjiwJCroxqHZIY11IIoN0l5lKqcgoAPKHt33H2mAkSfvzj8i44Jm7F4w== + dependencies: + "@typescript-eslint/types" "4.12.0" + "@typescript-eslint/visitor-keys" "4.12.0" + debug "^4.1.1" + globby "^11.0.1" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.12.0.tgz#a470a79be6958075fa91c725371a83baf428a67a" + integrity sha512-hVpsLARbDh4B9TKYz5cLbcdMIOAoBYgFPCSP9FFS/liSF+b33gVNq8JHY3QGhHNVz85hObvL7BEYLlgx553WCw== + dependencies: + "@typescript-eslint/types" "4.12.0" + eslint-visitor-keys "^2.0.0" + "@wdio/browserstack-service@6.1.4": version "6.1.4" resolved "https://registry.yarnpkg.com/@wdio/browserstack-service/-/browserstack-service-6.1.4.tgz#9e87e1da7bde60b192a93614a079efab5b4b12ee" @@ -1593,11 +1772,21 @@ accepts@~1.3.4, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-jsx@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + acorn@^6.2.1: version "6.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== +acorn@^7.4.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" @@ -1646,7 +1835,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@6.12.6: +ajv@6.12.6, ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1676,11 +1865,26 @@ ajv@^6.1.0, ajv@^6.10.2, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.0.3.tgz#13ae747eff125cafb230ac504b2406cf371eece2" + integrity sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -1869,6 +2073,17 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= +array-includes@^3.1.1, array-includes@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.2.tgz#a8db03e0b88c8c6aeddc49cb132f9bcab4ebf9c8" + integrity sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + get-intrinsic "^1.0.1" + is-string "^1.0.5" + array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -1876,6 +2091,11 @@ array-union@^1.0.2: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -1886,6 +2106,25 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.flat@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" + integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +array.prototype.flatmap@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" + integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + function-bind "^1.1.1" + arraybuffer.slice@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" @@ -2001,6 +2240,18 @@ babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-eslint@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + eslint-visitor-keys "^1.0.0" + resolve "^1.12.0" + babel-generator@^6.18.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" @@ -2379,11 +2630,6 @@ buffer@^5.2.1, buffer@^5.5.0: base64-js "^1.0.2" ieee754 "^1.1.4" -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -2484,6 +2730,14 @@ cacheable-request@^7.0.1: normalize-url "^4.1.0" responselike "^2.0.0" +call-bind@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" + integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.0" + call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" @@ -2513,6 +2767,11 @@ callsites@^2.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -2698,6 +2957,13 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +clean-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7" + integrity sha1-jffHquUf02h06PjQW5GAvBGj/tc= + dependencies: + escape-string-regexp "^1.0.5" + cli-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.0.tgz#11ecfb58a79278cf6035a60c54e338f9d837897c" @@ -2846,11 +3112,16 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.12.1, commander@^2.19.0, commander@^2.20.0: +commander@^2.19.0, commander@^2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== +comment-parser@^0.7.6: + version "0.7.6" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-0.7.6.tgz#0e743a53c8e646c899a1323db31f6cd337b10f12" + integrity sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -2959,6 +3230,11 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -3194,6 +3470,15 @@ cross-spawn@^4.0.2: lru-cache "^4.0.1" which "^1.2.9" +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -3275,7 +3560,7 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -3303,6 +3588,13 @@ debug@^3.1.0, debug@^3.2.6: dependencies: ms "^2.1.1" +debug@^4.0.1, debug@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -3343,6 +3635,11 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== +deep-is@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + deepmerge@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09" @@ -3483,11 +3780,6 @@ diff-sequences@^25.2.6: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - diff@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" @@ -3514,13 +3806,34 @@ dir-glob@^2.2.2: dependencies: path-type "^3.0.0" -doctrine@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523" - integrity sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM= +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== dependencies: - esutils "^1.1.6" - isarray "0.0.1" + path-type "^4.0.0" + +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" dom-serialize@^2.2.0: version "2.2.1" @@ -3708,6 +4021,13 @@ enhanced-resolve@4.1.0, enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: memory-fs "^0.4.0" tapable "^1.0.0" +enquirer@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + ent@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" @@ -3742,6 +4062,41 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.17.0-next.1: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.1: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + es-abstract@^1.4.3: version "1.16.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.0.tgz#d3a26dc9c3283ac9750dca569586e976d9dcc06d" @@ -3783,6 +4138,15 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.53" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" @@ -3841,6 +4205,113 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +eslint-ast-utils@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-ast-utils/-/eslint-ast-utils-1.1.0.tgz#3d58ba557801cfb1c941d68131ee9f8c34bd1586" + integrity sha512-otzzTim2/1+lVrlH19EfQQJEhVJSu0zOb9ygb3iapN6UlyaDtyRq4b5U1FuW0v1lRa9Fp/GJyHkSwm6NqABgCA== + dependencies: + lodash.get "^4.4.2" + lodash.zip "^4.2.0" + +eslint-config-prettier@7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f" + integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA== + +eslint-import-resolver-node@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" + integrity sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA== + dependencies: + debug "^2.6.9" + resolve "^1.13.1" + +eslint-module-utils@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz#579ebd094f56af7797d19c9866c9c9486629bfa6" + integrity sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA== + dependencies: + debug "^2.6.9" + pkg-dir "^2.0.0" + +eslint-plugin-import@2.22.1: + version "2.22.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz#0896c7e6a0cf44109a2d97b95903c2bb689d7702" + integrity sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw== + dependencies: + array-includes "^3.1.1" + array.prototype.flat "^1.2.3" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.4" + eslint-module-utils "^2.6.0" + has "^1.0.3" + minimatch "^3.0.4" + object.values "^1.1.1" + read-pkg-up "^2.0.0" + resolve "^1.17.0" + tsconfig-paths "^3.9.0" + +eslint-plugin-jsdoc@30.7.13: + version "30.7.13" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.13.tgz#52e5c74fb806d3bbeb51d04a0c829508c3c6b563" + integrity sha512-YM4WIsmurrp0rHX6XiXQppqKB8Ne5ATiZLJe2+/fkp9l9ExXFr43BbAbjZaVrpCT+tuPYOZ8k1MICARHnURUNQ== + dependencies: + comment-parser "^0.7.6" + debug "^4.3.1" + jsdoctypeparser "^9.0.0" + lodash "^4.17.20" + regextras "^0.7.1" + semver "^7.3.4" + spdx-expression-parse "^3.0.1" + +eslint-plugin-no-null@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-null/-/eslint-plugin-no-null-1.0.2.tgz#1236a812391390a1877ad4007c26e745341c951f" + integrity sha1-EjaoEjkTkKGHetQAfCbnRTQclR8= + +eslint-plugin-prefer-arrow@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.2.tgz#0c6d25a6b94cb3e0110a23d129760af5860edb6e" + integrity sha512-C8YMhL+r8RMeMdYAw/rQtE6xNdMulj+zGWud/qIGnlmomiPRaLDGLMeskZ3alN6uMBojmooRimtdrXebLN4svQ== + +eslint-plugin-react@7.22.0: + version "7.22.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz#3d1c542d1d3169c45421c1215d9470e341707269" + integrity sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA== + dependencies: + array-includes "^3.1.1" + array.prototype.flatmap "^1.2.3" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.4.1 || ^3.0.0" + object.entries "^1.1.2" + object.fromentries "^2.0.2" + object.values "^1.1.1" + prop-types "^15.7.2" + resolve "^1.18.1" + string.prototype.matchall "^4.0.2" + +eslint-plugin-unicorn@25.0.1: + version "25.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-25.0.1.tgz#bedcbc9b817042a44f6501584e8266741120f023" + integrity sha512-MEyEWoyou/qhJH6rEER9YHACtCsQT+eewc6Fdxbi2eiTvsGrBR8JZMA6qaeof3oMQeRxOpaERoBKzU7R5c4A/w== + dependencies: + ci-info "^2.0.0" + clean-regexp "^1.0.0" + eslint-ast-utils "^1.1.0" + eslint-template-visitor "^2.2.1" + eslint-utils "^2.1.0" + import-modules "^2.0.0" + lodash "^4.17.20" + pluralize "^8.0.0" + read-pkg-up "^7.0.1" + regexp-tree "^0.1.21" + reserved-words "^0.1.2" + safe-regex "^2.1.1" + semver "^7.3.4" + eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -3849,11 +4320,105 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^5.0.0, eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-template-visitor@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/eslint-template-visitor/-/eslint-template-visitor-2.2.2.tgz#46cd2b06eca5c1d97369aadd96e131df88fdd59c" + integrity sha512-SkcLjzKw3JjKTWHacRDeLBa2gxb600zbCKTkXj/V97QnZ9yxkknoPL8vc8PFueqbFXP7mYNTQzjCjcMpTRdRaA== + dependencies: + babel-eslint "^10.1.0" + eslint-visitor-keys "^2.0.0" + esquery "^1.3.1" + multimap "^1.1.0" + +eslint-utils@^2.0.0, eslint-utils@^2.1.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-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.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.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" + integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + +eslint@7.17.0: + version "7.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0" + integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@eslint/eslintrc" "^0.2.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.2.0" + esutils "^2.0.2" + file-entry-cache "^6.0.0" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash "^4.17.19" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.4" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esquery@^1.2.0, esquery@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" @@ -3861,15 +4426,22 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= -esutils@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375" - integrity sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U= +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== esutils@^2.0.2: version "2.0.2" @@ -4112,11 +4684,35 @@ fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" +fast-glob@^3.1.1: + version "3.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" + integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fastq@^1.6.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.10.0.tgz#74dbefccade964932cdf500473ef302719c652bb" + integrity sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA== + dependencies: + reusify "^1.0.4" + fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" @@ -4150,6 +4746,13 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" +file-entry-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" + integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA== + dependencies: + flat-cache "^3.0.4" + fileset@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" @@ -4205,7 +4808,7 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.0.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= @@ -4237,11 +4840,24 @@ findup-sync@3.0.0: micromatch "^3.0.4" resolve-dir "^1.0.1" +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + flatted@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== +flatted@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067" + integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA== + flush-write-stream@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -4377,6 +4993,11 @@ function-bind@^1.0.2, function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -4403,16 +5024,20 @@ genfun@^5.0.0: resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== -get-caller-file@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.0, get-caller-file@^2.0.1: +get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.0, get-intrinsic@^1.0.1, get-intrinsic@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" + integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + get-pkg-repo@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" @@ -4524,6 +5149,13 @@ glob-parent@^5.0.0: dependencies: is-glob "^4.0.1" +glob-parent@^5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + glob-promise@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-3.4.0.tgz#b6b8f084504216f702dc2ce8c9bc9ac8866fdb20" @@ -4601,11 +5233,30 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^12.1.0: + version "12.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" + integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== + dependencies: + type-fest "^0.8.1" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== +globby@^11.0.1: + version "11.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" + integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + globby@^9.2.0: version "9.2.0" resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" @@ -4742,6 +5393,11 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= +has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -4959,11 +5615,16 @@ ignore-walk@3.0.3, ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^4.0.3: +ignore@^4.0.3, ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -4972,6 +5633,14 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-local@2.0.0, import-local@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -4980,6 +5649,11 @@ import-local@2.0.0, import-local@^2.0.0: pkg-dir "^3.0.0" resolve-cwd "^2.0.0" +import-modules@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-modules/-/import-modules-2.1.0.tgz#abe7df297cb6c1f19b57246eb8b8bd9664b6d8c2" + integrity sha512-8HEWcnkbGpovH9yInoisxaSoIg9Brbul+Ju3Kqe2UsYDUBJD/iQjSgEj0zPcTDPKfPp2fs5xlv1i+JSye/m1/A== + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5092,6 +5766,15 @@ inquirer@^7.0.0: strip-ansi "^5.1.0" through "^2.3.6" +internal-slot@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" + integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== + dependencies: + es-abstract "^1.17.0-next.1" + has "^1.0.3" + side-channel "^1.0.2" + interpret@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -5104,11 +5787,6 @@ invariant@^2.2.2: dependencies: loose-envify "^1.0.0" -inversify@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/inversify/-/inversify-5.0.1.tgz#500d709b1434896ce5a0d58915c4a4210e34fb6e" - integrity sha512-Ieh06s48WnEYGcqHepdsJUIJUXpwH5o5vodAX+DK2JA/gjy4EbEcQZxw+uFfzysmKjiLXGYwNG3qDZsKVMcINQ== - invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -5167,6 +5845,11 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -5174,6 +5857,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" + integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== + dependencies: + has "^1.0.3" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -5271,6 +5961,11 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" +is-negative-zero@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -5329,6 +6024,13 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-regex@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" + integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== + dependencies: + has-symbols "^1.0.1" + is-running@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-running/-/is-running-2.1.0.tgz#30a73ff5cc3854e4fc25490809e9f5abf8de09e0" @@ -5346,6 +6048,11 @@ is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -5620,6 +6327,11 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdoctypeparser@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz#8c97e2fb69315eb274b0f01377eaa5c940bd7b26" + integrity sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw== + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -5680,11 +6392,21 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -5728,6 +6450,14 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +"jsx-ast-utils@^2.4.1 || ^3.0.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.0.tgz#41108d2cec408c3453c1bbe8a4aae9e1e2bd8f82" + integrity sha512-EIsmt3O3ljsU6sot/J4E1zDRxfBNrhjyf/OKjlydwgEimQuznlM4Wv7U+ueONJMyEn1WRE0K8dhi3dVAXYT24Q== + dependencies: + array-includes "^3.1.2" + object.assign "^4.1.2" + junit-report-builder@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/junit-report-builder/-/junit-report-builder-2.0.0.tgz#aaf9c8c6848cd9bb9dfb6da8e2f411d72ddf47aa" @@ -5907,6 +6637,14 @@ lerna@3.20.2: import-local "^2.0.0" npmlog "^4.1.2" +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + lighthouse-logger@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/lighthouse-logger/-/lighthouse-logger-1.2.0.tgz#b76d56935e9c137e86a04741f6bb9b2776e886ca" @@ -5931,6 +6669,16 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -6104,7 +6852,7 @@ lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== -lodash@^4.17.20: +lodash@^4.17.19, lodash@^4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -6140,7 +6888,7 @@ loglevel@^1.6.0: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.3.tgz#77f2eb64be55a404c9fd04ad16d57c1d6d6b1280" integrity sha512-LoEDv5pgpvWgPF4kNYuIp0qqSJVWak/dML0RY74xlzMZiT9w77teNAwKYKWBTYjlokMirg+o3jBwp+vlLrcfAA== -loose-envify@^1.0.0: +loose-envify@^1.0.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -6175,6 +6923,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + lru-queue@0.1: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" @@ -6383,6 +7138,11 @@ merge2@^1.2.3: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -6604,14 +7364,6 @@ mkdirp@^0.5.3: dependencies: minimist "^1.2.5" -mock-require@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/mock-require/-/mock-require-3.0.3.tgz#ccd544d9eae81dd576b3f219f69ec867318a1946" - integrity sha512-lLzfLHcyc10MKQnNUCv7dMcoY/2Qxd6wJfbqCcVk3LDb8An4hF6ohk5AztrvgKhJCqj36uyzi/p5se+tvyD+Wg== - dependencies: - get-caller-file "^1.0.2" - normalize-path "^2.1.1" - modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" @@ -6639,11 +7391,16 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@^2.0.0, ms@^2.1.1: +ms@2.1.2, ms@^2.0.0, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +multimap@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/multimap/-/multimap-1.1.0.tgz#5263febc085a1791c33b59bb3afc6a76a2a10ca8" + integrity sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw== + multimatch@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-3.0.0.tgz#0e2534cc6bc238d9ab67e1b9cd5fcd85a6dbf70b" @@ -6695,6 +7452,11 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + needle@^2.2.1: version "2.4.0" resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" @@ -6983,6 +7745,11 @@ object-inspect@^1.6.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== +object-inspect@^1.8.0, object-inspect@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" + integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== + object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -6995,6 +7762,36 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.1.1, object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.entries@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" + integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + has "^1.0.3" + +object.fromentries@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.3.tgz#13cefcffa702dc67750314a3305e8cb3fad1d072" + integrity sha512-IDUSMXs6LOSJBWE++L0lzIbSqHl9KDCfff2x/JSEIDtEUavUnyMYC2ZGay/04Zq4UT8lvd4xNhU4/YHKibAOlw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + has "^1.0.3" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -7010,6 +7807,16 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.values@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.2.tgz#7a2015e06fcb0f546bd652486ce8583a4731c731" + integrity sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + has "^1.0.3" + octokit-pagination-methods@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" @@ -7043,6 +7850,18 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -7219,6 +8038,13 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.4" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" @@ -7350,6 +8176,11 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -7376,6 +8207,13 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -7383,6 +8221,11 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pause-stream@0.0.11: version "0.0.11" resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" @@ -7416,6 +8259,11 @@ picomatch@^2.0.4, picomatch@^2.0.5: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== +picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + pidtree@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.0.tgz#f6fada10fccc9f99bf50e90d0b23d72c9ebc2e6b" @@ -7448,6 +8296,13 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -7455,11 +8310,21 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + prettier@2.2.1, prettier@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" @@ -7492,7 +8357,7 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@2.0.3, progress@^2.0.1: +progress@2.0.3, progress@^2.0.0, progress@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -7517,6 +8382,15 @@ promzard@^0.3.0: dependencies: read "1" +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -7724,7 +8598,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-is@^16.12.0: +react-is@^16.12.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -7765,6 +8639,14 @@ read-pkg-up@^1.0.1: find-up "^1.0.0" read-pkg "^1.0.0" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" @@ -7791,6 +8673,15 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" @@ -7911,11 +8802,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -reflect-metadata@^0.1.12: - version "0.1.13" - resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" - integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== - regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -7929,6 +8815,29 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexp-tree@^0.1.21, regexp-tree@~0.1.1: + version "0.1.21" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.21.tgz#55e2246b7f7d36f1b461490942fa780299c400d7" + integrity sha512-kUUXjX4AnqnR8KRTCrayAo9PzYMRKmVoGgaz2tBuz0MF3g1ZbGebmtW0yFHfFK9CmBjQKeYIgoL22pFLBJY7sw== + +regexp.prototype.flags@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + +regexpp@^3.0.0, regexpp@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" + integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== + +regextras@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.1.tgz#be95719d5f43f9ef0b9fa07ad89b7c606995a3b2" + integrity sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w== + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -7991,6 +8900,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -8001,6 +8915,11 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= +reserved-words@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/reserved-words/-/reserved-words-0.1.2.tgz#00a0940f98cd501aeaaac316411d9adc52b31ab1" + integrity sha1-AKCUD5jNUBrqqsMWQR2a3FKzGrE= + resolve-alpn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c" @@ -8036,13 +8955,21 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0, resolve@^1.3.2: +resolve@^1.10.0: version "1.11.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" +resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + responselike@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" @@ -8083,6 +9010,11 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rfdc@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" @@ -8141,6 +9073,11 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +run-parallel@^1.1.9: + version "1.1.10" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef" + integrity sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -8172,6 +9109,13 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" +safe-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-2.1.1.tgz#f7128f00d056e2fe5c11e81a1324dd974aadced2" + integrity sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A== + dependencies: + regexp-tree "~0.1.1" + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -8237,6 +9181,13 @@ semver@^6.2.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -8332,16 +9283,37 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shell-quote@^1.6.1: version "1.7.2" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== +side-channel@^1.0.2, side-channel@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -8558,6 +9530,14 @@ spdx-expression-parse@^3.0.0: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" +spdx-expression-parse@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + spdx-license-ids@^3.0.0: version "3.0.5" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" @@ -8746,6 +9726,19 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string.prototype.matchall@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.3.tgz#24243399bc31b0a49d19e2b74171a15653ec996a" + integrity sha512-OBxYDA2ifZQ2e13cP82dWFMaCV9CGF8GzmN4fljBVw5O5wep0lu4gacm1OL6MjROoUnB8VbkWRThqkV2YFLNxw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + has-symbols "^1.0.1" + internal-slot "^1.0.2" + regexp.prototype.flags "^1.3.0" + side-channel "^1.0.3" + string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -8755,6 +9748,14 @@ string.prototype.padend@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" +string.prototype.trimend@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" + integrity sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + string.prototype.trimleft@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" @@ -8771,6 +9772,14 @@ string.prototype.trimright@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" +string.prototype.trimstart@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" + integrity sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" @@ -8849,6 +9858,11 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + 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== + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -8899,6 +9913,16 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +table@^6.0.4: + version "6.0.7" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" + integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== + dependencies: + ajv "^7.0.2" + lodash "^4.17.20" + slice-ansi "^4.0.0" + string-width "^4.2.0" + tapable@^1.0.0, tapable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" @@ -9238,7 +10262,7 @@ tsconfig-paths-webpack-plugin@3.2.0: enhanced-resolve "^4.0.0" tsconfig-paths "^3.4.0" -tsconfig-paths@^3.4.0: +tsconfig-paths@^3.4.0, tsconfig-paths@^3.9.0: version "3.9.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== @@ -9248,92 +10272,15 @@ tsconfig-paths@^3.4.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" - integrity sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ== - -tslib@^1.10.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tslint-config-airbnb@5.11.1: - version "5.11.1" - resolved "https://registry.yarnpkg.com/tslint-config-airbnb/-/tslint-config-airbnb-5.11.1.tgz#51a27fbb8bf24c144d064a274a71da47e7ece617" - integrity sha512-hkaittm2607vVMe8eotANGN1CimD5tor7uoY3ypg2VTtEcDB/KGWYbJOz58t8LI4cWSyWtgqYQ5F0HwKxxhlkQ== - dependencies: - tslint-consistent-codestyle "^1.14.1" - tslint-eslint-rules "^5.4.0" - tslint-microsoft-contrib "~5.2.1" - -tslint-config-prettier@1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37" - integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg== - -tslint-consistent-codestyle@^1.14.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/tslint-consistent-codestyle/-/tslint-consistent-codestyle-1.15.1.tgz#a0c5cd5a5860d40b659c490d8013c5732e02af8c" - integrity sha512-38Y3Dz4zcABe/PlPAQSGNEWPGVq0OzcIQR7SEU6dNujp/SgvhxhJOhIhI9gY4r0I3/TNtvVQwARWor9O9LPZWg== - dependencies: - "@fimbul/bifrost" "^0.17.0" - tslib "^1.7.1" - tsutils "^2.29.0" - -tslint-eslint-rules@5.4.0, tslint-eslint-rules@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz#e488cc9181bf193fe5cd7bfca213a7695f1737b5" - integrity sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w== - dependencies: - doctrine "0.7.2" - tslib "1.9.0" - tsutils "^3.0.0" - -tslint-microsoft-contrib@~5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.2.1.tgz#a6286839f800e2591d041ea2800c77487844ad81" - integrity sha512-PDYjvpo0gN9IfMULwKk0KpVOPMhU6cNoT9VwCOLeDl/QS8v8W2yspRpFFuUS7/c5EIH/n8ApMi8TxJAz1tfFUA== - dependencies: - tsutils "^2.27.2 <2.29.0" - -tslint@5.18.0: - version "5.18.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6" - integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^3.2.0" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.29.0" - -"tsutils@^2.27.2 <2.29.0": - version "2.28.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1" - integrity sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA== - dependencies: - tslib "^1.8.1" - -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - -tsutils@^3.0.0, tsutils@^3.5.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.0.tgz#bf8d5a7bae5369331fa0f2b0a5a10bd7f7396c77" - integrity sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw== +tsutils@^3.17.1: + version "3.19.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.19.0.tgz#9387cb5fcb71579aa0909c509604f8a7fbe1cff1" + integrity sha512-A7BaLUPvcQ1cxVu72YfD+UMI3SQPTDv/w4ol6TOwLyI0hwfG9EC+cYlhdflJTmtYTgZ3KqdPSe/otxU4K3kArg== dependencies: tslib "^1.8.1" @@ -9354,6 +10301,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + type-detect@4.0.8, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -9417,15 +10371,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript-tslint-plugin@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/typescript-tslint-plugin/-/typescript-tslint-plugin-0.5.4.tgz#febe0cca1fe65133f4f688841eba68262a1d55a5" - integrity sha512-CQEfGC+p0SoBARI4N2LrGsWJsp4/OE+uKZ68xsWYKHWqMFq4DFQHqOVlK0deEricSN01NmDTqjap63Pw/DHieg== - dependencies: - minimatch "^3.0.4" - mock-require "^3.0.2" - vscode-languageserver "^5.1.0" - typescript@3.8.3: version "3.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" @@ -9609,6 +10554,11 @@ v8-compile-cache@2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== +v8-compile-cache@^2.0.3: + version "2.2.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" + integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== + validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -9653,37 +10603,6 @@ void-elements@^2.0.0: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= -vscode-jsonrpc@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9" - integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg== - -vscode-languageserver-protocol@3.14.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz#b8aab6afae2849c84a8983d39a1cf742417afe2f" - integrity sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g== - dependencies: - vscode-jsonrpc "^4.0.0" - vscode-languageserver-types "3.14.0" - -vscode-languageserver-types@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743" - integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A== - -vscode-languageserver@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.2.1.tgz#0d2feddd33f92aadf5da32450df498d52f6f14eb" - integrity sha512-GuayqdKZqAwwaCUjDvMTAVRPJOp/SLON3mJ07eGsx/Iq9HjRymhKWztX41rISqDKhHVVyFM+IywICyZDla6U3A== - dependencies: - vscode-languageserver-protocol "3.14.1" - vscode-uri "^1.0.6" - -vscode-uri@^1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.8.tgz#9769aaececae4026fb6e22359cb38946580ded59" - integrity sha512-obtSWTlbJ+a+TFRYGaUumtVwb+InIUVI0Lu0VBUAPmj2cU5JutEXg3xUE0c2J5Tcy7h2DEKVJBFi+Y9ZSFzzPQ== - watchpack@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" @@ -9877,6 +10796,13 @@ which@1, which@^1.2.1, which@^1.2.14, which@^1.2.9, which@^1.3.1: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -9891,6 +10817,11 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" @@ -10016,6 +10947,11 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yargs-parser@^13.1.0: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" From 7e79271c613f30b04b3a3b47d94662593143451a Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 15:58:51 +0100 Subject: [PATCH 02/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20import/order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- scripts/dev-server.js | 2 +- scripts/generate-changelog.js | 6 +++--- test/e2e/lib/framework/serverApps/mock.ts | 2 +- test/e2e/wdio.base.conf.js | 2 +- test/e2e/wdio.bs.conf.js | 2 +- test/unit/karma.bs.conf.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ced4dffa03..66be30363b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,6 @@ module.exports = { ], rules: { 'no-shadow': 0, - 'import/order': 0, 'no-redeclare': 0, 'no-null/no-null': 0, 'arrow-body-style': 0, @@ -92,6 +91,7 @@ module.exports = { }, ], + 'import/order': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', diff --git a/scripts/dev-server.js b/scripts/dev-server.js index c9c0e6eff6..062b7d660e 100644 --- a/scripts/dev-server.js +++ b/scripts/dev-server.js @@ -1,7 +1,7 @@ +const path = require('path') const express = require('express') const middleware = require('webpack-dev-middleware') const webpack = require('webpack') -const path = require('path') const logsConfig = require('../packages/logs/webpack.config') const rumConfig = require('../packages/rum/webpack.config') diff --git a/scripts/generate-changelog.js b/scripts/generate-changelog.js index 74e6774756..1afcbbeb37 100644 --- a/scripts/generate-changelog.js +++ b/scripts/generate-changelog.js @@ -1,10 +1,10 @@ 'use strict' -const replace = require('replace-in-file') const util = require('util') -const exec = util.promisify(require('child_process').exec) -const readFile = util.promisify(require('fs').readFile) const spawn = require('child_process').spawn +const readFile = util.promisify(require('fs').readFile) +const exec = util.promisify(require('child_process').exec) +const replace = require('replace-in-file') const emojiNameMap = require('emoji-name-map') diff --git a/test/e2e/lib/framework/serverApps/mock.ts b/test/e2e/lib/framework/serverApps/mock.ts index 88da0e6cc9..14ce594481 100644 --- a/test/e2e/lib/framework/serverApps/mock.ts +++ b/test/e2e/lib/framework/serverApps/mock.ts @@ -1,6 +1,6 @@ +import * as url from 'url' import cors from 'cors' import express from 'express' -import * as url from 'url' import { buildLogs, buildNpm, buildRum, Endpoints } from '../sdkBuilds' export function createMockServerApp(endpoints: Endpoints, setup: string) { diff --git a/test/e2e/wdio.base.conf.js b/test/e2e/wdio.base.conf.js index 28addd4ee9..cd0361a5a9 100644 --- a/test/e2e/wdio.base.conf.js +++ b/test/e2e/wdio.base.conf.js @@ -1,6 +1,6 @@ const path = require('path') -const getTestReportDirectory = require('../getTestReportDirectory') const { unlinkSync, mkdirSync } = require('fs') +const getTestReportDirectory = require('../getTestReportDirectory') const reporters = ['spec'] let logsPath diff --git a/test/e2e/wdio.bs.conf.js b/test/e2e/wdio.bs.conf.js index b13986d958..5e214de71f 100644 --- a/test/e2e/wdio.bs.conf.js +++ b/test/e2e/wdio.bs.conf.js @@ -1,6 +1,6 @@ +const { getBuildInfos } = require('../utils') const baseConf = require('./wdio.base.conf') const browsers = require('./browsers.conf') -const { getBuildInfos } = require('../utils') exports.config = { ...baseConf, diff --git a/test/unit/karma.bs.conf.js b/test/unit/karma.bs.conf.js index 8f27212671..37de2618e7 100644 --- a/test/unit/karma.bs.conf.js +++ b/test/unit/karma.bs.conf.js @@ -1,6 +1,6 @@ -const karmaBaseConf = require('./karma.base.conf') const browsers = require('../browsers.conf') const { getBuildInfos, getIp } = require('../utils') +const karmaBaseConf = require('./karma.base.conf') module.exports = function (config) { config.set({ From 8d8066e9dbcb112eac0fdfa97741eb402416c21f Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 16:08:31 +0100 Subject: [PATCH 03/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20arrow-body-st?= =?UTF-8?q?yle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/domain/configuration.ts | 4 +--- packages/logs/src/boot/logs.entry.ts | 4 +--- packages/rum-core/src/boot/rum.ts | 6 ++---- packages/rum-core/src/boot/rumPublicApi.ts | 8 ++------ .../rum-core/src/domain/parentContexts.ts | 8 ++------ .../action/getActionNameFromElement.ts | 4 +--- .../action/trackActions.spec.ts | 4 +--- .../view/trackTimings.spec.ts | 20 +++++-------------- .../view/trackViews.spec.ts | 11 +++++----- .../rum-recorder/src/domain/rrweb/observer.ts | 11 ++++------ 11 files changed, 25 insertions(+), 57 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 66be30363b..4b2af280c6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,7 +26,6 @@ module.exports = { 'no-shadow': 0, 'no-redeclare': 0, 'no-null/no-null': 0, - 'arrow-body-style': 0, 'no-throw-literal': 0, 'prefer-rest-params': 0, 'no-underscore-dangle': 0, @@ -92,6 +91,7 @@ module.exports = { ], 'import/order': 'error', + 'arrow-body-style': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', diff --git a/packages/core/src/domain/configuration.ts b/packages/core/src/domain/configuration.ts index 85ad258ff8..5510e0d934 100644 --- a/packages/core/src/domain/configuration.ts +++ b/packages/core/src/domain/configuration.ts @@ -144,9 +144,7 @@ export function buildConfiguration(userConfiguration: UserConfiguration, buildEn const configuration: Configuration = { beforeSend: userConfiguration.beforeSend, cookieOptions: buildCookieOptions(userConfiguration), - isEnabled: (feature: string) => { - return includes(enableExperimentalFeatures, feature) - }, + isEnabled: (feature: string) => includes(enableExperimentalFeatures, feature), logsEndpoint: getEndpoint(intakeType, 'logs', transportConfiguration), proxyHost: userConfiguration.proxyHost, rumEndpoint: getEndpoint(intakeType, 'rum', transportConfiguration), diff --git a/packages/logs/src/boot/logs.entry.ts b/packages/logs/src/boot/logs.entry.ts index 5a9eb7c38d..9f90618a29 100644 --- a/packages/logs/src/boot/logs.entry.ts +++ b/packages/logs/src/boot/logs.entry.ts @@ -83,9 +83,7 @@ export function makeLogsPublicApi(startLogsImpl: StartLogs) { return customLoggers[name]! }), - getLogger: monitor((name: string) => { - return customLoggers[name] - }), + getLogger: monitor((name: string) => customLoggers[name]), }) function canInitLogs(userConfiguration: LogsUserConfiguration) { diff --git a/packages/rum-core/src/boot/rum.ts b/packages/rum-core/src/boot/rum.ts index f1abe89e8f..26ed7e2ac4 100644 --- a/packages/rum-core/src/boot/rum.ts +++ b/packages/rum-core/src/boot/rum.ts @@ -24,15 +24,13 @@ export function startRum(userConfiguration: RumUserConfiguration, getCommonConte const { configuration, internalMonitoring } = commonInit(userConfiguration, buildEnv) const session = startRumSession(configuration, lifeCycle) - internalMonitoring.setExternalContextProvider(() => { - return combine( + internalMonitoring.setExternalContextProvider(() => combine( { application_id: userConfiguration.applicationId, }, parentContexts.findView(), getCommonContext().context - ) - }) + )) const { parentContexts, addError, addAction, addTiming } = startRumEventCollection( userConfiguration.applicationId, diff --git a/packages/rum-core/src/boot/rumPublicApi.ts b/packages/rum-core/src/boot/rumPublicApi.ts index 465a858055..afa108e984 100644 --- a/packages/rum-core/src/boot/rumPublicApi.ts +++ b/packages/rum-core/src/boot/rumPublicApi.ts @@ -34,9 +34,7 @@ export function makeRumPublicApi(startRumImpl: StartRum) { const globalContextManager = createContextManager() let user: User = {} - let getInternalContextStrategy: ReturnType['getInternalContext'] = () => { - return undefined - } + let getInternalContextStrategy: ReturnType['getInternalContext'] = () => undefined const beforeInitAddAction = new BoundedBuffer<[CustomAction, CommonContext]>() let addActionStrategy: ReturnType['addAction'] = (action) => { @@ -97,9 +95,7 @@ export function makeRumPublicApi(startRumImpl: StartRum) { getRumGlobalContext: monitor(globalContextManager.get), setRumGlobalContext: monitor(globalContextManager.set), - getInternalContext: monitor((startTime?: number) => { - return getInternalContextStrategy(startTime) - }), + getInternalContext: monitor((startTime?: number) => getInternalContextStrategy(startTime)), addAction: monitor((name: string, context?: object) => { addActionStrategy({ diff --git a/packages/rum-core/src/domain/parentContexts.ts b/packages/rum-core/src/domain/parentContexts.ts index 94184aad33..1020533a20 100644 --- a/packages/rum-core/src/domain/parentContexts.ts +++ b/packages/rum-core/src/domain/parentContexts.ts @@ -131,12 +131,8 @@ export function startParentContexts(lifeCycle: LifeCycle, session: RumSession): } return { - findAction: (startTime) => { - return findContext(buildCurrentActionContext, previousActions, currentAction, startTime) - }, - findView: (startTime) => { - return findContext(buildCurrentViewContext, previousViews, currentView, startTime) - }, + findAction: (startTime) => findContext(buildCurrentActionContext, previousActions, currentAction, startTime), + findView: (startTime) => findContext(buildCurrentViewContext, previousViews, currentView, startTime), stop: () => { window.clearInterval(clearOldContextsInterval) }, diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts index 22ff62f159..bbd24da082 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts @@ -104,9 +104,7 @@ const priorityStrategies: NameStrategy[] = [ ] const fallbackStrategies: NameStrategy[] = [ - (element) => { - return getTextualContent(element) - }, + (element) => getTextualContent(element), ] /** diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts index 625d0c8eb1..cc01b0492a 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts @@ -148,9 +148,7 @@ describe('newAction', () => { document.body.appendChild(root) setupBuilder = setup() .withFakeClock() - .beforeBuild(({ lifeCycle }) => { - return trackActions(lifeCycle) - }) + .beforeBuild(({ lifeCycle }) => trackActions(lifeCycle)) }) afterEach(() => { diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.spec.ts index 0939789f7e..96a166fb8a 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.spec.ts @@ -48,9 +48,7 @@ describe('trackTimings', () => { beforeEach(() => { timingsCallback = jasmine.createSpy() - setupBuilder = setup().beforeBuild(({ lifeCycle }) => { - return trackTimings(lifeCycle, timingsCallback) - }) + setupBuilder = setup().beforeBuild(({ lifeCycle }) => trackTimings(lifeCycle, timingsCallback)) }) afterEach(() => { @@ -83,9 +81,7 @@ describe('trackNavigationTimings', () => { beforeEach(() => { navigationTimingsCallback = jasmine.createSpy() - setupBuilder = setup().beforeBuild(({ lifeCycle }) => { - return trackNavigationTimings(lifeCycle, navigationTimingsCallback) - }) + setupBuilder = setup().beforeBuild(({ lifeCycle }) => trackNavigationTimings(lifeCycle, navigationTimingsCallback)) }) afterEach(() => { @@ -113,9 +109,7 @@ describe('trackFirstContentfulPaint', () => { beforeEach(() => { fcpCallback = jasmine.createSpy() - setupBuilder = setup().beforeBuild(({ lifeCycle }) => { - return trackFirstContentfulPaint(lifeCycle, fcpCallback) - }) + setupBuilder = setup().beforeBuild(({ lifeCycle }) => trackFirstContentfulPaint(lifeCycle, fcpCallback)) resetFirstHidden() }) @@ -150,9 +144,7 @@ describe('largestContentfulPaint', () => { beforeEach(() => { lcpCallback = jasmine.createSpy() emitter = document.createElement('div') - setupBuilder = setup().beforeBuild(({ lifeCycle }) => { - return trackLargestContentfulPaint(lifeCycle, emitter, lcpCallback) - }) + setupBuilder = setup().beforeBuild(({ lifeCycle }) => trackLargestContentfulPaint(lifeCycle, emitter, lcpCallback)) resetFirstHidden() }) @@ -197,9 +189,7 @@ describe('firstInputTimings', () => { beforeEach(() => { fitCallback = jasmine.createSpy() - setupBuilder = setup().beforeBuild(({ lifeCycle }) => { - return trackFirstInputTimings(lifeCycle, fitCallback) - }) + setupBuilder = setup().beforeBuild(({ lifeCycle }) => trackFirstInputTimings(lifeCycle, fitCallback)) resetFirstHidden() }) diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts index 81bc84565c..23c410ad83 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts @@ -52,9 +52,8 @@ const FAKE_NAVIGATION_ENTRY_WITH_LOADEVENT_AFTER_ACTIVITY_TIMING: RumPerformance } function mockGetElementById() { - return spyOn(document, 'getElementById').and.callFake((elementId: string) => { - return (elementId === ('testHashValue' as unknown)) as any - }) + const fakeGetElementById = (elementId: string) => (elementId === ('testHashValue' as unknown)) as any + return spyOn(document, 'getElementById').and.callFake(fakeGetElementById) } function spyOnViews() { @@ -774,9 +773,9 @@ describe('rum view measures', () => { pending('No PerformanceObserver support') } isLayoutShiftSupported = true - spyOnProperty(PerformanceObserver, 'supportedEntryTypes', 'get').and.callFake(() => { - return isLayoutShiftSupported ? ['layout-shift'] : [] - }) + spyOnProperty(PerformanceObserver, 'supportedEntryTypes', 'get').and.callFake(() => + isLayoutShiftSupported ? ['layout-shift'] : [] + ) }) it('should be initialized to 0', () => { diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index b582bac9ba..7b950526a7 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -126,8 +126,7 @@ function initMouseInteractionObserver( sampling.mouseInteraction === true || sampling.mouseInteraction === undefined ? {} : sampling.mouseInteraction const handlers: ListenerHandler[] = [] - const getHandler = (eventKey: keyof typeof MouseInteractions) => { - return (event: MouseEvent | TouchEvent) => { + const getHandler = (eventKey: keyof typeof MouseInteractions) => (event: MouseEvent | TouchEvent) => { if (isBlocked(event.target as Node, blockClass)) { return } @@ -140,7 +139,6 @@ function initMouseInteractionObserver( y: clientY, }) } - } ;(Object.keys(MouseInteractions) as Array) .filter((key) => Number.isNaN(Number(key)) && !key.endsWith('_Departed') && disableMap[key] !== false) .forEach((eventKey: keyof typeof MouseInteractions) => { @@ -339,8 +337,7 @@ function initCanvasMutationObserver(cb: CanvasMutationCallback, blockClass: Bloc const restoreHandler = patch( CanvasRenderingContext2D.prototype, prop, - (original: (...args: unknown[]) => unknown) => { - return function (this: CanvasRenderingContext2D, ...args: unknown[]) { + (original: (...args: unknown[]) => unknown) => function (this: CanvasRenderingContext2D, ...args: unknown[]) { if (!isBlocked(this.canvas, blockClass)) { setTimeout(() => { const recordArgs = [...args] @@ -358,7 +355,6 @@ function initCanvasMutationObserver(cb: CanvasMutationCallback, blockClass: Bloc } return original.apply(this, args) } - } ) handlers.push(restoreHandler) } catch { @@ -407,7 +403,7 @@ function initFontObserver(cb: FontCallback): ListenerHandler { } const restoreHandler = patch(document.fonts, 'add', (original: (fontFace: FontFace) => unknown) => { - return function (this: FontFaceSet, fontFace: FontFace) { + function fn(this: FontFaceSet, fontFace: FontFace) { setTimeout(() => { const p = fontMap.get(fontFace) if (p) { @@ -417,6 +413,7 @@ function initFontObserver(cb: FontCallback): ListenerHandler { }, 0) return original.apply(this, [fontFace]) } + return fn }) handlers.push(() => { From c1b4569f03218ea9f13da9d372ba859b36ae5589 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 16:10:42 +0100 Subject: [PATCH 04/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/dot-notation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- test/e2e/browsers.conf.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 4b2af280c6..99acbeff2a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -34,7 +34,6 @@ module.exports = { '@typescript-eslint/indent': 0, 'import/no-internal-modules': 0, '@typescript-eslint/array-type': 0, - '@typescript-eslint/dot-notation': 0, 'jsdoc/newline-after-description': 0, '@typescript-eslint/no-extra-semi': 0, '@typescript-eslint/require-await': 0, @@ -92,6 +91,7 @@ module.exports = { 'import/order': 'error', 'arrow-body-style': 'error', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', diff --git a/test/e2e/browsers.conf.js b/test/e2e/browsers.conf.js index 2ae24cf2d0..bd9247523f 100644 --- a/test/e2e/browsers.conf.js +++ b/test/e2e/browsers.conf.js @@ -1,18 +1,18 @@ const browsers = require('../browsers.conf') module.exports = [ - browsers['SAFARI'], + browsers.SAFARI, { - ...browsers['EDGE'], + ...browsers.EDGE, // Without this specific version, execute and executeAsync fails on Edge. 'browserstack.selenium_version': '3.5.2', // Note: more recent versions of selenium 3 have the same issue, but selenium 4 seems to be // fine: // 'browserstack.selenium_version': '4.0.0-alpha-6', }, - browsers['FIREFOX'], + browsers.FIREFOX, { - ...browsers['CHROME_MOBILE'], + ...browsers.CHROME_MOBILE, // cf https://github.com/webdriverio/webdriverio/issues/3264, 'browserstack.appium_version': '1.9.1', }, From 6afb03126a45c7fd18e5fae1992e27f136f02aa8 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 16:12:26 +0100 Subject: [PATCH 05/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-unnecessary-type-assertion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/browser/fetchProxy.ts | 2 +- packages/core/src/browser/xhrProxy.ts | 2 +- packages/core/src/domain/internalMonitoring.spec.ts | 4 ++-- packages/core/src/domain/tracekitParser.spec.ts | 2 +- packages/core/src/tools/context.ts | 4 ++-- packages/core/src/tools/utils.spec.ts | 2 +- packages/core/test/forEach.spec.ts | 4 ++-- packages/logs/src/boot/logs.entry.spec.ts | 4 ++-- packages/logs/src/domain/logger.spec.ts | 2 +- packages/rum-core/src/domain/assembly.ts | 1 + .../rumEventsCollection/action/trackActions.spec.ts | 2 +- packages/rum-core/test/specHelper.ts | 2 +- packages/rum-recorder/src/domain/rrweb/utils.ts | 4 ++-- test/e2e/lib/framework/httpServers.ts | 2 +- test/e2e/lib/framework/serverApps/intake.ts | 2 +- test/e2e/lib/helpers/browser.ts | 2 +- test/e2e/scenario/logs.scenario.ts | 8 ++++---- test/e2e/scenario/rum/tracing.scenario.ts | 6 +++--- 19 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 99acbeff2a..dccf921dd9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -58,7 +58,6 @@ module.exports = { '@typescript-eslint/restrict-plus-operands': 0, '@typescript-eslint/no-unsafe-member-access': 0, '@typescript-eslint/restrict-template-expressions': 0, - '@typescript-eslint/no-unnecessary-type-assertion': 0, '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/ban-types': [ 0, @@ -92,6 +91,7 @@ module.exports = { 'import/order': 'error', 'arrow-body-style': 'error', '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', diff --git a/packages/core/src/browser/fetchProxy.ts b/packages/core/src/browser/fetchProxy.ts index 65379adf66..5d5be39065 100644 --- a/packages/core/src/browser/fetchProxy.ts +++ b/packages/core/src/browser/fetchProxy.ts @@ -83,7 +83,7 @@ function proxyFetch() { } const reportFetch = async (response: Response | Error) => { - context.duration = performance.now() - context.startTime! + context.duration = performance.now() - context.startTime if ('stack' in response || response instanceof Error) { context.status = 0 diff --git a/packages/core/src/browser/xhrProxy.ts b/packages/core/src/browser/xhrProxy.ts index ea6f6f887e..5ada2a440f 100644 --- a/packages/core/src/browser/xhrProxy.ts +++ b/packages/core/src/browser/xhrProxy.ts @@ -103,7 +103,7 @@ function proxyXhr() { } hasBeenReported = true - this._datadog_xhr.duration = performance.now() - this._datadog_xhr.startTime! + this._datadog_xhr.duration = performance.now() - this._datadog_xhr.startTime this._datadog_xhr.response = this.response as string | undefined this._datadog_xhr.status = this.status diff --git a/packages/core/src/domain/internalMonitoring.spec.ts b/packages/core/src/domain/internalMonitoring.spec.ts index 9035357da7..8da5bedbd1 100644 --- a/packages/core/src/domain/internalMonitoring.spec.ts +++ b/packages/core/src/domain/internalMonitoring.spec.ts @@ -217,13 +217,13 @@ describe('internal monitoring', () => { monitor(() => { throw new Error('message') })() - expect((JSON.parse(server.requests[0].requestBody) as any).foo).toEqual('bar') + expect((JSON.parse(server.requests[0].requestBody) ).foo).toEqual('bar') internalMonitoring.setExternalContextProvider(() => ({})) monitor(() => { throw new Error('message') })() - expect((JSON.parse(server.requests[1].requestBody) as any).foo).not.toBeDefined() + expect((JSON.parse(server.requests[1].requestBody) ).foo).not.toBeDefined() }) }) }) diff --git a/packages/core/src/domain/tracekitParser.spec.ts b/packages/core/src/domain/tracekitParser.spec.ts index 58b72af54a..32b7ffd65a 100644 --- a/packages/core/src/domain/tracekitParser.spec.ts +++ b/packages/core/src/domain/tracekitParser.spec.ts @@ -25,7 +25,7 @@ describe('Parser', () => { const expected = ['baz', 'bar', 'foo'] for (let i = 1; i <= 3; i += 1) { - expect(trace.stack![i].func).toEqual(expected[i - 1]) + expect(trace.stack[i].func).toEqual(expected[i - 1]) } }) diff --git a/packages/core/src/tools/context.ts b/packages/core/src/tools/context.ts index 6a34881de8..e2eb6360aa 100644 --- a/packages/core/src/tools/context.ts +++ b/packages/core/src/tools/context.ts @@ -8,10 +8,10 @@ export interface ContextArray extends Array {} export function withSnakeCaseKeys(candidate: Context): Context { const result: Context = {} - Object.keys(candidate as Context).forEach((key: string) => { + Object.keys(candidate ).forEach((key: string) => { result[toSnakeCase(key)] = deepSnakeCase(candidate[key]) }) - return result as Context + return result } export function deepSnakeCase(candidate: ContextValue): ContextValue { diff --git a/packages/core/src/tools/utils.spec.ts b/packages/core/src/tools/utils.spec.ts index 1d4a73c1b9..f6ef8fca4c 100644 --- a/packages/core/src/tools/utils.spec.ts +++ b/packages/core/src/tools/utils.spec.ts @@ -253,7 +253,7 @@ describe('utils', () => { it('should not crash on serialization error', () => { const circularReference: any = { otherData: 123 } - ;(circularReference as any).myself = circularReference + ;(circularReference ).myself = circularReference expect(jsonStringify(circularReference)).toEqual('') }) diff --git a/packages/core/test/forEach.spec.ts b/packages/core/test/forEach.spec.ts index 14e3a4ffad..0dff96c48b 100644 --- a/packages/core/test/forEach.spec.ts +++ b/packages/core/test/forEach.spec.ts @@ -3,8 +3,8 @@ import { clearAllCookies } from '../src/tools/specHelper' beforeEach(() => { ;(navigator.sendBeacon as any) = false // reset globals - ;((window as any).DD_LOGS as any) = {} - ;((window as any).DD_RUM as any) = {} + ;((window as any).DD_LOGS ) = {} + ;((window as any).DD_RUM ) = {} }) afterEach(() => { diff --git a/packages/logs/src/boot/logs.entry.spec.ts b/packages/logs/src/boot/logs.entry.spec.ts index 5dc92569a6..416f6f4c3a 100644 --- a/packages/logs/src/boot/logs.entry.spec.ts +++ b/packages/logs/src/boot/logs.entry.spec.ts @@ -62,7 +62,7 @@ describe('logs entry', () => { }) it('should add a `_setDebug` that works', () => { - const setDebug: (debug: boolean) => void = (LOGS as any)._setDebug as any + const setDebug: (debug: boolean) => void = (LOGS as any)._setDebug expect(!!setDebug).toEqual(true) spyOn(console, 'warn') @@ -170,7 +170,7 @@ describe('logs entry', () => { location.href = `#tata${Math.random()}` LOGS.init(DEFAULT_INIT_CONFIGURATION) - expect(getLoggedMessage(0).context.view!.url).toEqual(initialLocation) + expect(getLoggedMessage(0).context.view.url).toEqual(initialLocation) }) it('stores a deep copy of the global context', () => { diff --git a/packages/logs/src/domain/logger.spec.ts b/packages/logs/src/domain/logger.spec.ts index 892c80e85e..427542b0df 100644 --- a/packages/logs/src/domain/logger.spec.ts +++ b/packages/logs/src/domain/logger.spec.ts @@ -22,7 +22,7 @@ describe('Logger', () => { STATUSES.forEach((status) => { it(`'logger.${status}' should have ${status} status`, () => { - ;((logger as any)[status] as any)('message') + ;((logger as any)[status] )('message') expect(getLoggedMessage(0).status).toEqual(status) }) diff --git a/packages/rum-core/src/domain/assembly.ts b/packages/rum-core/src/domain/assembly.ts index fb3b696ef0..82412d051f 100644 --- a/packages/rum-core/src/domain/assembly.ts +++ b/packages/rum-core/src/domain/assembly.ts @@ -81,6 +81,7 @@ export function startRumAssembly( } if (!isEmptyObject(commonContext.user)) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ;(serverRumEvent.usr as RumEvent['usr']) = commonContext.user as User & Context } diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts index cc01b0492a..a6ed36e91f 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts @@ -191,7 +191,7 @@ describe('newAction', () => { lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, collectedRawRumEvent) expect(events.length).toBe(1) - const action = events[0] as AutoAction + const action = events[0] expect(action.counts).toEqual({ errorCount: 2, longTaskCount: 0, diff --git a/packages/rum-core/test/specHelper.ts b/packages/rum-core/test/specHelper.ts index 4bf805c3e6..cf24685136 100644 --- a/packages/rum-core/test/specHelper.ts +++ b/packages/rum-core/test/specHelper.ts @@ -87,7 +87,7 @@ export function setup(): TestSetupBuilder { withFakeLocation(initialUrl: string) { fakeLocation = buildLocation(initialUrl, location.href) spyOn(history, 'pushState').and.callFake((_: any, __: string, pathname: string) => { - assign(fakeLocation, buildLocation(pathname, fakeLocation.href!)) + assign(fakeLocation, buildLocation(pathname, fakeLocation.href)) }) function hashchangeCallBack() { diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index 05d58ca0c2..b018eccd5e 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -72,7 +72,7 @@ export function hookSetter( set(this: T, value) { // put hooked setter into event loop to avoid of set latency setTimeout(() => { - d.set!.call(this, value) + d.set.call(this, value) }, 0) if (original && original.set) { original.set.call(this, value) @@ -165,7 +165,7 @@ export function isBlocked(node: Node | null, blockClass: BlockClass): boolean { export function isIgnored(n: Node | INode): boolean { if ('__sn' in n) { - return (n as INode).__sn.id === IGNORED_NODE + return (n ).__sn.id === IGNORED_NODE } // The main part of the slimDOM check happens in // rrweb-snapshot::serializeNodeWithId diff --git a/test/e2e/lib/framework/httpServers.ts b/test/e2e/lib/framework/httpServers.ts index fec890e087..0824306761 100644 --- a/test/e2e/lib/framework/httpServers.ts +++ b/test/e2e/lib/framework/httpServers.ts @@ -75,7 +75,7 @@ async function instantiateServer(): Promise { try { return await instantiateServerOnPort(port) } catch (error) { - if ((error as any).code === 'EADDRINUSE') { + if ((error ).code === 'EADDRINUSE') { continue } throw error diff --git a/test/e2e/lib/framework/serverApps/intake.ts b/test/e2e/lib/framework/serverApps/intake.ts index 35a3505b70..90ea0aa2b6 100644 --- a/test/e2e/lib/framework/serverApps/intake.ts +++ b/test/e2e/lib/framework/serverApps/intake.ts @@ -9,7 +9,7 @@ export function createIntakeServerApp(events: EventRegistry) { app.post('/v1/input/:endpoint', (req, res) => { const endpoint = req.params.endpoint if (endpoint === 'rum' || endpoint === 'logs' || endpoint === 'internalMonitoring') { - ;(req.body as string).split('\n').map((rawEvent) => events.push(endpoint, JSON.parse(rawEvent) as any)) + ;(req.body as string).split('\n').map((rawEvent) => events.push(endpoint, JSON.parse(rawEvent) )) } res.end() }) diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index ab3b7b9538..3b17277f18 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -1,6 +1,6 @@ // typing issue for execute https://github.com/webdriverio/webdriverio/issues/3796 export async function browserExecute(fn: any) { - return browser.execute(fn as any) + return browser.execute(fn ) } export async function browserExecuteAsync( diff --git a/test/e2e/scenario/logs.scenario.ts b/test/e2e/scenario/logs.scenario.ts index 90f4ec977b..72f580e9bc 100644 --- a/test/e2e/scenario/logs.scenario.ts +++ b/test/e2e/scenario/logs.scenario.ts @@ -66,15 +66,15 @@ describe('logs', () => { expect(events.logs.length).toEqual(2) - const unreachableRequest = events.logs.find((log) => log.http!.url.includes('/unreachable'))! - const throwRequest = events.logs.find((log) => log.http!.url.includes('/throw'))! + const unreachableRequest = events.logs.find((log) => log.http.url.includes('/unreachable'))! + const throwRequest = events.logs.find((log) => log.http.url.includes('/throw'))! expect(throwRequest.message).toEqual(`Fetch error GET ${baseUrl}/throw`) - expect(throwRequest.http!.status_code).toEqual(500) + expect(throwRequest.http.status_code).toEqual(500) expect(throwRequest.error!.stack).toMatch(/Server error/) expect(unreachableRequest.message).toEqual(`Fetch error GET ${UNREACHABLE_URL}`) - expect(unreachableRequest.http!.status_code).toEqual(0) + expect(unreachableRequest.http.status_code).toEqual(0) expect(unreachableRequest.error!.stack).toContain('TypeError') }) }) diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index 62328503ab..ec49bac730 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -28,7 +28,7 @@ describe('tracing', () => { }) function checkRequestHeaders(rawHeaders: string) { - const headers: { [key: string]: string } = JSON.parse(rawHeaders) as any + const headers: { [key: string]: string } = JSON.parse(rawHeaders) expect(headers['x-datadog-trace-id']).toMatch(/\d+/) expect(headers['x-datadog-origin']).toBe('rum') expect(headers['x-foo']).toBe('bar, baz') @@ -39,8 +39,8 @@ describe('tracing', () => { (event) => event.resource.type === 'xhr' || event.resource.type === 'fetch' ) expect(requests.length).toBe(1) - expect(requests[0]._dd!.trace_id).toMatch(/\d+/) - expect(requests[0]._dd!.span_id).toMatch(/\d+/) + expect(requests[0]._dd.trace_id).toMatch(/\d+/) + expect(requests[0]._dd.span_id).toMatch(/\d+/) expect(requests[0].resource.id).toBeDefined() } }) From f92c9d100af61238082a1938a2fd93a632f829ea Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 17:18:51 +0100 Subject: [PATCH 06/69] Update licences of 3rd party dependencies --- .eslintrc.js | 1 - LICENSE-3rdparty.csv | 14 +++-- package.json | 1 - yarn.lock | 141 +++---------------------------------------- 4 files changed, 16 insertions(+), 141 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index dccf921dd9..c0f34f4e86 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,7 +19,6 @@ module.exports = { 'eslint-plugin-no-null', 'eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', - 'eslint-plugin-react', '@typescript-eslint', ], rules: { diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 397b05e40c..84f20804f2 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -8,6 +8,8 @@ dev,@types/cors,MIT,Copyright Microsoft Corporation dev,@types/express,MIT,Copyright Microsoft Corporation dev,@types/jasmine,MIT,Copyright Microsoft Corporation dev,@types/sinon,MIT,Copyright Microsoft Corporation +dev,@typescript-eslint/eslint-plugin,MIT,Copyright JS Foundation and other contributors +dev,@typescript-eslint/parser,MIT,Copyright JS Foundation and other contributors dev,@wdio/browserstack-service,MIT,Copyright JS Foundation and other contributors dev,@wdio/cli,MIT,Copyright JS Foundation and other contributors dev,@wdio/jasmine-framework,MIT,Copyright JS Foundation and other contributors @@ -21,6 +23,13 @@ dev,browserstack-local,MIT,Copyright 2016 BrowserStack dev,codecov,MIT,Copyright 2014 Gregg Caines dev,cors,MIT,Copyright 2013 Troy Goode dev,emoji-name-map,MIT,Copyright 2016-19 Ionică Bizău (https://ionicabizau.net) +dev,eslint,MIT,Copyright JS Foundation and other contributors +dev,eslint-config-prettier,MIT,Copyright (c) 2017, 2018, 2019, 2020 Simon Lydell and contributors +dev,eslint-plugin-import,MIT,Copyright (c) 2015 Ben Mosher +dev,eslint-plugin-jsdoc,BSD-3-Clause,Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) +dev,eslint-plugin-no-null,MIT,Copyright (c) 2016 Rene Saarsoo +dev,eslint-plugin-prefer-arrow,MIT,Copyright (c) 2018 Triston Jones +dev,eslint-plugin-unicorn,MIT,Copyright (c) Sindre Sorhus (https://sindresorhus.com) dev,express,MIT,Copyright 2009-2014 TJ Holowaychuk 2013-2014 Roman Shtylman 2014-2015 Douglas Christopher Wilson dev,istanbul-instrumenter-loader,MIT,Copyright JS Foundation and other contributors dev,jasmine-core,MIT,Copyright 2008-2017 Pivotal Labs @@ -44,12 +53,7 @@ dev,string-replace-loader,MIT,Copyright 2015 Valentyn Barmashyn dev,ts-loader,MIT,Copyright 2015 TypeStrong dev,ts-node,MIT,Copyright 2014 Blake Embrey dev,tsconfig-paths-webpack-plugin,MIT,Copyright 2016 Jonas Kello -dev,tslint,Apache-2.0, -dev,tslint-config-airbnb,Apache-2.0,Copyright 2017 Progre -dev,tslint-config-prettier,MIT,Copyright 2017 Alex Jover Morales -dev,tslint-eslint-rules,MIT,Copyright 2015 Vitor Buzinaro Victor Schiavi dev,typescript,Apache-2.0,Copyright Microsoft Corporation -dev,typescript-tslint-plugin,MIT,Copyright 2018 Microsoft dev,webdriverio,MIT,Copyright JS Foundation and other contributors dev,webpack,MIT,Copyright JS Foundation and other contributors dev,webpack-cli,MIT,Copyright JS Foundation and other contributors diff --git a/package.json b/package.json index 1d568c3b4c..fe3d694b22 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "eslint-plugin-jsdoc": "30.7.13", "eslint-plugin-no-null": "1.0.2", "eslint-plugin-prefer-arrow": "1.2.2", - "eslint-plugin-react": "7.22.0", "eslint-plugin-unicorn": "25.0.1", "express": "4.17.1", "istanbul-instrumenter-loader": "3.0.1", diff --git a/yarn.lock b/yarn.lock index 2c5fac54e9..9c99ab4b9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2073,7 +2073,7 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= -array-includes@^3.1.1, array-includes@^3.1.2: +array-includes@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.2.tgz#a8db03e0b88c8c6aeddc49cb132f9bcab4ebf9c8" integrity sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw== @@ -2115,16 +2115,6 @@ array.prototype.flat@^1.2.3: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -array.prototype.flatmap@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" - integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - function-bind "^1.1.1" - arraybuffer.slice@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" @@ -3821,13 +3811,6 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -4062,23 +4045,6 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1: - version "1.17.7" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" - integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" - is-regex "^1.1.1" - object-inspect "^1.8.0" - object-keys "^1.1.1" - object.assign "^4.1.1" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" - es-abstract@^1.18.0-next.1: version "1.18.0-next.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" @@ -4276,23 +4242,6 @@ eslint-plugin-prefer-arrow@1.2.2: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.2.tgz#0c6d25a6b94cb3e0110a23d129760af5860edb6e" integrity sha512-C8YMhL+r8RMeMdYAw/rQtE6xNdMulj+zGWud/qIGnlmomiPRaLDGLMeskZ3alN6uMBojmooRimtdrXebLN4svQ== -eslint-plugin-react@7.22.0: - version "7.22.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz#3d1c542d1d3169c45421c1215d9470e341707269" - integrity sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA== - dependencies: - array-includes "^3.1.1" - array.prototype.flatmap "^1.2.3" - doctrine "^2.1.0" - has "^1.0.3" - jsx-ast-utils "^2.4.1 || ^3.0.0" - object.entries "^1.1.2" - object.fromentries "^2.0.2" - object.values "^1.1.1" - prop-types "^15.7.2" - resolve "^1.18.1" - string.prototype.matchall "^4.0.2" - eslint-plugin-unicorn@25.0.1: version "25.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-25.0.1.tgz#bedcbc9b817042a44f6501584e8266741120f023" @@ -5029,7 +4978,7 @@ get-caller-file@^2.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.0, get-intrinsic@^1.0.1, get-intrinsic@^1.0.2: +get-intrinsic@^1.0.0, get-intrinsic@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== @@ -5766,15 +5715,6 @@ inquirer@^7.0.0: strip-ansi "^5.1.0" through "^2.3.6" -internal-slot@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" - integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== - dependencies: - es-abstract "^1.17.0-next.1" - has "^1.0.3" - side-channel "^1.0.2" - interpret@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -6450,14 +6390,6 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -"jsx-ast-utils@^2.4.1 || ^3.0.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.0.tgz#41108d2cec408c3453c1bbe8a4aae9e1e2bd8f82" - integrity sha512-EIsmt3O3ljsU6sot/J4E1zDRxfBNrhjyf/OKjlydwgEimQuznlM4Wv7U+ueONJMyEn1WRE0K8dhi3dVAXYT24Q== - dependencies: - array-includes "^3.1.2" - object.assign "^4.1.2" - junit-report-builder@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/junit-report-builder/-/junit-report-builder-2.0.0.tgz#aaf9c8c6848cd9bb9dfb6da8e2f411d72ddf47aa" @@ -6888,7 +6820,7 @@ loglevel@^1.6.0: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.3.tgz#77f2eb64be55a404c9fd04ad16d57c1d6d6b1280" integrity sha512-LoEDv5pgpvWgPF4kNYuIp0qqSJVWak/dML0RY74xlzMZiT9w77teNAwKYKWBTYjlokMirg+o3jBwp+vlLrcfAA== -loose-envify@^1.0.0, loose-envify@^1.4.0: +loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -7745,7 +7677,7 @@ object-inspect@^1.6.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== -object-inspect@^1.8.0, object-inspect@^1.9.0: +object-inspect@^1.8.0: version "1.9.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== @@ -7762,7 +7694,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.1, object.assign@^4.1.2: +object.assign@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== @@ -7772,26 +7704,6 @@ object.assign@^4.1.1, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" - integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - has "^1.0.3" - -object.fromentries@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.3.tgz#13cefcffa702dc67750314a3305e8cb3fad1d072" - integrity sha512-IDUSMXs6LOSJBWE++L0lzIbSqHl9KDCfff2x/JSEIDtEUavUnyMYC2ZGay/04Zq4UT8lvd4xNhU4/YHKibAOlw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - has "^1.0.3" - object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -8382,15 +8294,6 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.7.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.8.1" - proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -8598,7 +8501,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-is@^16.12.0, react-is@^16.8.1: +react-is@^16.12.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -8820,14 +8723,6 @@ regexp-tree@^0.1.21, regexp-tree@~0.1.1: resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.21.tgz#55e2246b7f7d36f1b461490942fa780299c400d7" integrity sha512-kUUXjX4AnqnR8KRTCrayAo9PzYMRKmVoGgaz2tBuz0MF3g1ZbGebmtW0yFHfFK9CmBjQKeYIgoL22pFLBJY7sw== -regexp.prototype.flags@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" - integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" @@ -8962,7 +8857,7 @@ resolve@^1.10.0: dependencies: path-parse "^1.0.6" -resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1: +resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0: version "1.19.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== @@ -9305,15 +9200,6 @@ shell-quote@^1.6.1: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== -side-channel@^1.0.2, side-channel@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -9726,19 +9612,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.matchall@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.3.tgz#24243399bc31b0a49d19e2b74171a15653ec996a" - integrity sha512-OBxYDA2ifZQ2e13cP82dWFMaCV9CGF8GzmN4fljBVw5O5wep0lu4gacm1OL6MjROoUnB8VbkWRThqkV2YFLNxw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - has-symbols "^1.0.1" - internal-slot "^1.0.2" - regexp.prototype.flags "^1.3.0" - side-channel "^1.0.3" - string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" From 8212bc3acbf5bc558dbbfb88898eb90c33ea1884 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 17:32:32 +0100 Subject: [PATCH 07/69] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20prettier=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/domain/internalMonitoring.spec.ts | 4 +-- packages/core/src/domain/tracekit.spec.ts | 2 +- packages/core/src/domain/tracekit.ts | 2 +- .../core/src/domain/tracekitHandler.spec.ts | 2 +- .../core/src/domain/tracekitParser.spec.ts | 2 +- packages/core/src/tools/context.ts | 4 +-- packages/core/src/tools/utils.spec.ts | 2 +- packages/core/src/tools/utils.ts | 2 +- packages/core/test/forEach.spec.ts | 4 +-- packages/logs/src/boot/logs.entry.spec.ts | 2 +- packages/logs/src/domain/logger.spec.ts | 2 +- packages/rum-core/src/boot/rum.ts | 6 +++-- .../action/getActionNameFromElement.ts | 4 +-- .../action/trackActions.spec.ts | 2 +- .../rum-recorder/src/domain/rrweb/observer.ts | 25 ++++++++++--------- .../rum-recorder/src/domain/rrweb/utils.ts | 2 +- test/e2e/lib/framework/httpServers.ts | 2 +- test/e2e/lib/framework/serverApps/intake.ts | 2 +- test/e2e/lib/helpers/browser.ts | 2 +- test/e2e/scenario/rum/tracing.scenario.ts | 2 +- tsconfig.eslint.json | 2 +- 21 files changed, 39 insertions(+), 38 deletions(-) diff --git a/packages/core/src/domain/internalMonitoring.spec.ts b/packages/core/src/domain/internalMonitoring.spec.ts index 8da5bedbd1..b21343d4e3 100644 --- a/packages/core/src/domain/internalMonitoring.spec.ts +++ b/packages/core/src/domain/internalMonitoring.spec.ts @@ -217,13 +217,13 @@ describe('internal monitoring', () => { monitor(() => { throw new Error('message') })() - expect((JSON.parse(server.requests[0].requestBody) ).foo).toEqual('bar') + expect(JSON.parse(server.requests[0].requestBody).foo).toEqual('bar') internalMonitoring.setExternalContextProvider(() => ({})) monitor(() => { throw new Error('message') })() - expect((JSON.parse(server.requests[1].requestBody) ).foo).not.toBeDefined() + expect(JSON.parse(server.requests[1].requestBody).foo).not.toBeDefined() }) }) }) diff --git a/packages/core/src/domain/tracekit.spec.ts b/packages/core/src/domain/tracekit.spec.ts index a6bf569de5..4efe720f5f 100644 --- a/packages/core/src/domain/tracekit.spec.ts +++ b/packages/core/src/domain/tracekit.spec.ts @@ -1,4 +1,4 @@ -// eslint-disable +// eslint-disable import { computeStackTrace, Handler, report } from './tracekit' diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index f6d73cfcd4..9a0128fb94 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -1,4 +1,4 @@ -// eslint-disable +// eslint-disable import { monitor } from './internalMonitoring' diff --git a/packages/core/src/domain/tracekitHandler.spec.ts b/packages/core/src/domain/tracekitHandler.spec.ts index fb2df76b3a..09fa3b4ce3 100644 --- a/packages/core/src/domain/tracekitHandler.spec.ts +++ b/packages/core/src/domain/tracekitHandler.spec.ts @@ -1,4 +1,4 @@ -// eslint-disable +// eslint-disable import { report, StackFrame, wrap } from './tracekit' diff --git a/packages/core/src/domain/tracekitParser.spec.ts b/packages/core/src/domain/tracekitParser.spec.ts index 32b7ffd65a..6c76a737ad 100644 --- a/packages/core/src/domain/tracekitParser.spec.ts +++ b/packages/core/src/domain/tracekitParser.spec.ts @@ -1,4 +1,4 @@ -// eslint-disable +// eslint-disable import * as CapturedExceptions from '../../test/capturedExceptions' import { isSafari } from '../tools/specHelper' diff --git a/packages/core/src/tools/context.ts b/packages/core/src/tools/context.ts index e2eb6360aa..36b2c58170 100644 --- a/packages/core/src/tools/context.ts +++ b/packages/core/src/tools/context.ts @@ -8,10 +8,10 @@ export interface ContextArray extends Array {} export function withSnakeCaseKeys(candidate: Context): Context { const result: Context = {} - Object.keys(candidate ).forEach((key: string) => { + Object.keys(candidate).forEach((key: string) => { result[toSnakeCase(key)] = deepSnakeCase(candidate[key]) }) - return result + return result } export function deepSnakeCase(candidate: ContextValue): ContextValue { diff --git a/packages/core/src/tools/utils.spec.ts b/packages/core/src/tools/utils.spec.ts index f6ef8fca4c..e2a4e68469 100644 --- a/packages/core/src/tools/utils.spec.ts +++ b/packages/core/src/tools/utils.spec.ts @@ -253,7 +253,7 @@ describe('utils', () => { it('should not crash on serialization error', () => { const circularReference: any = { otherData: 123 } - ;(circularReference ).myself = circularReference + circularReference.myself = circularReference expect(jsonStringify(circularReference)).toEqual('') }) diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 03d95a7347..4c0378d3fa 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -188,7 +188,7 @@ function hasToJSON(value: unknown): value is ObjectWithToJSON { export function includes(candidate: string, search: string): boolean export function includes(candidate: T[], search: T): boolean export function includes(candidate: string | unknown[], search: any) { - // eslint-disable-next-line + // eslint-disable-next-line return candidate.indexOf(search) !== -1 } diff --git a/packages/core/test/forEach.spec.ts b/packages/core/test/forEach.spec.ts index 0dff96c48b..a4f5fdd7ef 100644 --- a/packages/core/test/forEach.spec.ts +++ b/packages/core/test/forEach.spec.ts @@ -3,8 +3,8 @@ import { clearAllCookies } from '../src/tools/specHelper' beforeEach(() => { ;(navigator.sendBeacon as any) = false // reset globals - ;((window as any).DD_LOGS ) = {} - ;((window as any).DD_RUM ) = {} + ;(window as any).DD_LOGS = {} + ;(window as any).DD_RUM = {} }) afterEach(() => { diff --git a/packages/logs/src/boot/logs.entry.spec.ts b/packages/logs/src/boot/logs.entry.spec.ts index 416f6f4c3a..01efb310ea 100644 --- a/packages/logs/src/boot/logs.entry.spec.ts +++ b/packages/logs/src/boot/logs.entry.spec.ts @@ -62,7 +62,7 @@ describe('logs entry', () => { }) it('should add a `_setDebug` that works', () => { - const setDebug: (debug: boolean) => void = (LOGS as any)._setDebug + const setDebug: (debug: boolean) => void = (LOGS as any)._setDebug expect(!!setDebug).toEqual(true) spyOn(console, 'warn') diff --git a/packages/logs/src/domain/logger.spec.ts b/packages/logs/src/domain/logger.spec.ts index 427542b0df..9aa030c323 100644 --- a/packages/logs/src/domain/logger.spec.ts +++ b/packages/logs/src/domain/logger.spec.ts @@ -22,7 +22,7 @@ describe('Logger', () => { STATUSES.forEach((status) => { it(`'logger.${status}' should have ${status} status`, () => { - ;((logger as any)[status] )('message') + ;(logger as any)[status]('message') expect(getLoggedMessage(0).status).toEqual(status) }) diff --git a/packages/rum-core/src/boot/rum.ts b/packages/rum-core/src/boot/rum.ts index 26ed7e2ac4..3a7d3a2bf4 100644 --- a/packages/rum-core/src/boot/rum.ts +++ b/packages/rum-core/src/boot/rum.ts @@ -24,13 +24,15 @@ export function startRum(userConfiguration: RumUserConfiguration, getCommonConte const { configuration, internalMonitoring } = commonInit(userConfiguration, buildEnv) const session = startRumSession(configuration, lifeCycle) - internalMonitoring.setExternalContextProvider(() => combine( + internalMonitoring.setExternalContextProvider(() => + combine( { application_id: userConfiguration.applicationId, }, parentContexts.findView(), getCommonContext().context - )) + ) + ) const { parentContexts, addError, addAction, addTiming } = startRumEventCollection( userConfiguration.applicationId, diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts index bbd24da082..36b7766a45 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts @@ -103,9 +103,7 @@ const priorityStrategies: NameStrategy[] = [ }, ] -const fallbackStrategies: NameStrategy[] = [ - (element) => getTextualContent(element), -] +const fallbackStrategies: NameStrategy[] = [(element) => getTextualContent(element)] /** * Iterates over the target element and its parent, using the strategies list to get an action name. diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts index a6ed36e91f..bfbc89d403 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts @@ -191,7 +191,7 @@ describe('newAction', () => { lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, collectedRawRumEvent) expect(events.length).toBe(1) - const action = events[0] + const action = events[0] expect(action.counts).toEqual({ errorCount: 2, longTaskCount: 0, diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index 7b950526a7..a57bf3be20 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -127,18 +127,18 @@ function initMouseInteractionObserver( const handlers: ListenerHandler[] = [] const getHandler = (eventKey: keyof typeof MouseInteractions) => (event: MouseEvent | TouchEvent) => { - if (isBlocked(event.target as Node, blockClass)) { - return - } - const id = mirror.getId(event.target as INode) - const { clientX, clientY } = isTouchEvent(event) ? event.changedTouches[0] : event - cb({ - id, - type: MouseInteractions[eventKey], - x: clientX, - y: clientY, - }) + if (isBlocked(event.target as Node, blockClass)) { + return } + const id = mirror.getId(event.target as INode) + const { clientX, clientY } = isTouchEvent(event) ? event.changedTouches[0] : event + cb({ + id, + type: MouseInteractions[eventKey], + x: clientX, + y: clientY, + }) + } ;(Object.keys(MouseInteractions) as Array) .filter((key) => Number.isNaN(Number(key)) && !key.endsWith('_Departed') && disableMap[key] !== false) .forEach((eventKey: keyof typeof MouseInteractions) => { @@ -337,7 +337,8 @@ function initCanvasMutationObserver(cb: CanvasMutationCallback, blockClass: Bloc const restoreHandler = patch( CanvasRenderingContext2D.prototype, prop, - (original: (...args: unknown[]) => unknown) => function (this: CanvasRenderingContext2D, ...args: unknown[]) { + (original: (...args: unknown[]) => unknown) => + function (this: CanvasRenderingContext2D, ...args: unknown[]) { if (!isBlocked(this.canvas, blockClass)) { setTimeout(() => { const recordArgs = [...args] diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index b018eccd5e..decf60708d 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -165,7 +165,7 @@ export function isBlocked(node: Node | null, blockClass: BlockClass): boolean { export function isIgnored(n: Node | INode): boolean { if ('__sn' in n) { - return (n ).__sn.id === IGNORED_NODE + return n.__sn.id === IGNORED_NODE } // The main part of the slimDOM check happens in // rrweb-snapshot::serializeNodeWithId diff --git a/test/e2e/lib/framework/httpServers.ts b/test/e2e/lib/framework/httpServers.ts index 0824306761..8ac0cbd42f 100644 --- a/test/e2e/lib/framework/httpServers.ts +++ b/test/e2e/lib/framework/httpServers.ts @@ -75,7 +75,7 @@ async function instantiateServer(): Promise { try { return await instantiateServerOnPort(port) } catch (error) { - if ((error ).code === 'EADDRINUSE') { + if (error.code === 'EADDRINUSE') { continue } throw error diff --git a/test/e2e/lib/framework/serverApps/intake.ts b/test/e2e/lib/framework/serverApps/intake.ts index 90ea0aa2b6..a179a9f875 100644 --- a/test/e2e/lib/framework/serverApps/intake.ts +++ b/test/e2e/lib/framework/serverApps/intake.ts @@ -9,7 +9,7 @@ export function createIntakeServerApp(events: EventRegistry) { app.post('/v1/input/:endpoint', (req, res) => { const endpoint = req.params.endpoint if (endpoint === 'rum' || endpoint === 'logs' || endpoint === 'internalMonitoring') { - ;(req.body as string).split('\n').map((rawEvent) => events.push(endpoint, JSON.parse(rawEvent) )) + ;(req.body as string).split('\n').map((rawEvent) => events.push(endpoint, JSON.parse(rawEvent))) } res.end() }) diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index 3b17277f18..95925ba836 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -1,6 +1,6 @@ // typing issue for execute https://github.com/webdriverio/webdriverio/issues/3796 export async function browserExecute(fn: any) { - return browser.execute(fn ) + return browser.execute(fn) } export async function browserExecuteAsync( diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index ec49bac730..e27c59345e 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -28,7 +28,7 @@ describe('tracing', () => { }) function checkRequestHeaders(rawHeaders: string) { - const headers: { [key: string]: string } = JSON.parse(rawHeaders) + const headers: { [key: string]: string } = JSON.parse(rawHeaders) expect(headers['x-datadog-trace-id']).toMatch(/\d+/) expect(headers['x-datadog-origin']).toBe('rum') expect(headers['x-foo']).toBe('bar, baz') diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index ce89aba829..2861c158c0 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", "include": ["./.eslintrc.js", "./**/*.js", "./*.js", "./**/*.ts"] -} \ No newline at end of file +} From 671a965db2252f62395618f41527aea7ab1a788d Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 12 Jan 2021 17:43:25 +0100 Subject: [PATCH 08/69] =?UTF-8?q?=F0=9F=94=A8=20Ignore=20special=20cases?= =?UTF-8?q?=20of=20@typescript-eslint/no-unnecessary-type-assertion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/scenario/internalMonitoring.scenario.ts | 1 + test/e2e/scenario/logs.scenario.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/test/e2e/scenario/internalMonitoring.scenario.ts b/test/e2e/scenario/internalMonitoring.scenario.ts index 4fc668bfa6..e71b5fbae4 100644 --- a/test/e2e/scenario/internalMonitoring.scenario.ts +++ b/test/e2e/scenario/internalMonitoring.scenario.ts @@ -15,6 +15,7 @@ describe('internal monitoring', () => { throw new window.Error('bar') }, } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion window.DD_LOGS!.logger.log('hop', context as any) }) await flushEvents() diff --git a/test/e2e/scenario/logs.scenario.ts b/test/e2e/scenario/logs.scenario.ts index 72f580e9bc..293ff54786 100644 --- a/test/e2e/scenario/logs.scenario.ts +++ b/test/e2e/scenario/logs.scenario.ts @@ -9,6 +9,7 @@ describe('logs', () => { .withLogs() .run(async ({ events }) => { await browserExecute(() => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion window.DD_LOGS!.logger.log('hello') }) await flushEvents() @@ -35,6 +36,7 @@ describe('logs', () => { .withLogs() .run(async ({ events }) => { await browserExecute(() => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion window.DD_LOGS!.logger.log('hello') }) await flushEvents() From cf13c1c39fa7f7ad01b56461a0feb3fc757f7c6c Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 14 Jan 2021 11:00:50 +0100 Subject: [PATCH 09/69] =?UTF-8?q?=F0=9F=91=8C=20Add=20new=20line=20at=20th?= =?UTF-8?q?e=20end=20of=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 22664df6c7..1487728f13 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,3 @@ bundle cjs -esm \ No newline at end of file +esm From 55659d8a5039afb5883b558d03d73a4295c4df01 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 14 Jan 2021 15:20:03 +0100 Subject: [PATCH 10/69] =?UTF-8?q?=F0=9F=91=8C=20Reuse=20tsconfig=20files?= =?UTF-8?q?=20for=20ESLint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- test/e2e/tsconfig.json | 2 +- tsconfig.eslint.json | 4 ---- tsconfig.json | 10 +++++++++- 4 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 tsconfig.eslint.json diff --git a/.eslintrc.js b/.eslintrc.js index c0f34f4e86..ea76470f9c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,7 +10,7 @@ module.exports = { ], parser: '@typescript-eslint/parser', parserOptions: { - project: 'tsconfig.eslint.json', + project: ['./tsconfig.json', './test/app/tsconfig.json', './test/e2e/tsconfig.json'], sourceType: 'module', }, plugins: [ diff --git a/test/e2e/tsconfig.json b/test/e2e/tsconfig.json index 23767ccb72..80d81e4047 100644 --- a/test/e2e/tsconfig.json +++ b/test/e2e/tsconfig.json @@ -15,5 +15,5 @@ "@datadog/browser-core": ["../../packages/core/src"] } }, - "include": ["./scenario/**/*.ts", "./lib/**/*.ts", "./*.d.ts"] + "include": ["./*.js", "./**/*.js", "./scenario/**/*.ts", "./lib/**/*.ts", "./*.d.ts"] } diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json deleted file mode 100644 index 2861c158c0..0000000000 --- a/tsconfig.eslint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["./.eslintrc.js", "./**/*.js", "./*.js", "./**/*.ts"] -} diff --git a/tsconfig.json b/tsconfig.json index 207cd099d5..d8647d01f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,13 @@ // This tsconfig is only used for tooling (ex: typecheck in code editors) { "extends": "./tsconfig.base.json", - "include": ["./packages/**/src/**/*.ts", "./packages/**/test/**/*.ts"] + "include": [ + "./*.js", + "./packages/**/*.js", + "./packages/**/*.ts", + "./scripts/**/*.js", + "./test/*.js", + "./test/unit/*.js", + "./.eslintrc.js" + ] } From 23bf1b8c13be1e174f24d426c025e23727e3a058 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 14 Jan 2021 15:52:43 +0100 Subject: [PATCH 11/69] =?UTF-8?q?=F0=9F=91=8C=20Enable=20ESLint=20for=20pa?= =?UTF-8?q?ckages/core/src/domain/tracekit.spec.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/domain/tracekit.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/core/src/domain/tracekit.spec.ts b/packages/core/src/domain/tracekit.spec.ts index 4efe720f5f..4685f6d58c 100644 --- a/packages/core/src/domain/tracekit.spec.ts +++ b/packages/core/src/domain/tracekit.spec.ts @@ -1,5 +1,3 @@ -// eslint-disable - import { computeStackTrace, Handler, report } from './tracekit' describe('TraceKit', () => { From c1368b8864325ec43b6c88c6f6ad6667dec393ff Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 14 Jan 2021 16:04:46 +0100 Subject: [PATCH 12/69] =?UTF-8?q?=F0=9F=91=8C=20Ignore=20test/app/dist=20a?= =?UTF-8?q?nd=20sandbox=20from=20ESLint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintignore b/.eslintignore index 1487728f13..24421204c0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,5 @@ bundle cjs esm +test/app/dist +./sandbox From 5dcb4e62dd2f20f6f745098c36a8055cae3fa5c9 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 12:26:10 +0100 Subject: [PATCH 13/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20unused=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 81 ++++++++++++++++++++------------------------ LICENSE-3rdparty.csv | 1 - package.json | 1 - 3 files changed, 36 insertions(+), 47 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ea76470f9c..7e789c3e36 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,50 +16,34 @@ module.exports = { plugins: [ 'eslint-plugin-unicorn', 'eslint-plugin-import', - 'eslint-plugin-no-null', 'eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', '@typescript-eslint', ], rules: { - 'no-shadow': 0, - 'no-redeclare': 0, - 'no-null/no-null': 0, - 'no-throw-literal': 0, - 'prefer-rest-params': 0, - 'no-underscore-dangle': 0, - 'unicorn/filename-case': 0, - 'jsdoc/check-indentation': 0, - '@typescript-eslint/indent': 0, - 'import/no-internal-modules': 0, - '@typescript-eslint/array-type': 0, - 'jsdoc/newline-after-description': 0, - '@typescript-eslint/no-extra-semi': 0, - '@typescript-eslint/require-await': 0, - '@typescript-eslint/await-thenable': 0, - '@typescript-eslint/ban-ts-comment': 0, - '@typescript-eslint/no-unused-vars': 0, - '@typescript-eslint/no-unsafe-call': 0, - 'import/no-extraneous-dependencies': 0, - '@typescript-eslint/unbound-method': 0, - '@typescript-eslint/member-ordering': 0, - '@typescript-eslint/no-for-in-array': 0, - '@typescript-eslint/no-var-requires': 0, - '@typescript-eslint/no-unsafe-return': 0, - '@typescript-eslint/naming-convention': 0, - '@typescript-eslint/no-empty-interface': 0, - '@typescript-eslint/prefer-regexp-exec': 0, - '@typescript-eslint/no-inferrable-types': 0, - '@typescript-eslint/no-floating-promises': 0, - '@typescript-eslint/no-unsafe-assignment': 0, - '@typescript-eslint/no-non-null-assertion': 0, - '@typescript-eslint/promise-function-async': 0, - '@typescript-eslint/restrict-plus-operands': 0, - '@typescript-eslint/no-unsafe-member-access': 0, - '@typescript-eslint/restrict-template-expressions': 0, - '@typescript-eslint/explicit-module-boundary-types': 0, + // Temporary disabled rules + '@typescript-eslint/array-type': 'off', + '@typescript-eslint/no-extra-semi': 'off', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/await-thenable': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/unbound-method': 'off', + '@typescript-eslint/member-ordering': 'off', + '@typescript-eslint/no-for-in-array': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/prefer-regexp-exec': 'off', + '@typescript-eslint/no-inferrable-types': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/ban-types': [ - 0, + 'off', { types: { Object: { @@ -86,20 +70,27 @@ module.exports = { }, }, ], + 'no-redeclare': 'off', + 'no-shadow': 'off', + 'no-throw-literal': 'off', + 'no-underscore-dangle': 'off', + 'prefer-rest-params': 'off', + 'jsdoc/check-indentation': 'off', + 'jsdoc/newline-after-description': 'off', + 'unicorn/filename-case': 'off', - 'import/order': 'error', 'arrow-body-style': 'error', - '@typescript-eslint/dot-notation': 'error', - '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-member-accessibility': [ 'off', { accessibility: 'explicit', }, ], + '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/member-delimiter-style': [ 'off', { @@ -125,7 +116,9 @@ module.exports = { '@typescript-eslint/no-parameter-properties': 'off', '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', - + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unused-expressions': 'error', '@typescript-eslint/no-use-before-define': 'off', '@typescript-eslint/prefer-as-const': 'error', @@ -167,6 +160,7 @@ module.exports = { ], 'id-match': 'error', 'import/no-default-export': 'error', + 'import/order': 'error', 'jsdoc/check-alignment': 'error', 'linebreak-style': 'off', 'max-classes-per-file': 'off', @@ -217,9 +211,6 @@ module.exports = { 'prefer-template': 'error', 'quote-props': 'off', radix: 'error', - 'react/jsx-curly-spacing': 'off', - 'react/jsx-equals-spacing': 'off', - 'react/jsx-wrap-multilines': 'off', 'require-await': 'off', 'space-before-function-paren': 'off', 'space-in-parens': ['off', 'never'], diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 84f20804f2..89afc8e1ea 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -27,7 +27,6 @@ dev,eslint,MIT,Copyright JS Foundation and other contributors dev,eslint-config-prettier,MIT,Copyright (c) 2017, 2018, 2019, 2020 Simon Lydell and contributors dev,eslint-plugin-import,MIT,Copyright (c) 2015 Ben Mosher dev,eslint-plugin-jsdoc,BSD-3-Clause,Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) -dev,eslint-plugin-no-null,MIT,Copyright (c) 2016 Rene Saarsoo dev,eslint-plugin-prefer-arrow,MIT,Copyright (c) 2018 Triston Jones dev,eslint-plugin-unicorn,MIT,Copyright (c) Sindre Sorhus (https://sindresorhus.com) dev,express,MIT,Copyright 2009-2014 TJ Holowaychuk 2013-2014 Roman Shtylman 2014-2015 Douglas Christopher Wilson diff --git a/package.json b/package.json index fe3d694b22..241cd30cec 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "eslint-config-prettier": "7.1.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "30.7.13", - "eslint-plugin-no-null": "1.0.2", "eslint-plugin-prefer-arrow": "1.2.2", "eslint-plugin-unicorn": "25.0.1", "express": "4.17.1", From 60684cead93e596d60a25b420eafea92c0f214a2 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 12:28:16 +0100 Subject: [PATCH 14/69] =?UTF-8?q?=F0=9F=91=8C=20Refactor=20ESLint=20commen?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/browser/fetchProxy.ts | 1 - packages/core/src/domain/internalMonitoring.ts | 1 - packages/core/src/domain/tracekit.spec.ts | 2 -- packages/core/src/domain/tracekit.ts | 3 --- packages/core/src/domain/tracekitHandler.spec.ts | 2 -- packages/core/src/tools/context.spec.ts | 6 ++---- packages/core/src/tools/limitModification.spec.ts | 1 - packages/core/src/tools/utils.spec.ts | 1 - packages/core/src/tools/utils.ts | 1 - packages/core/test/capturedExceptions.ts | 4 +--- packages/rum-core/src/boot/rumPublicApi.spec.ts | 2 -- packages/rum-core/src/browser/domMutationCollection.spec.ts | 1 - packages/rum-core/src/domain/requestCollection.spec.ts | 1 - .../rumEventsCollection/action/getActionNameFromElement.ts | 1 - packages/rum-core/src/rumEvent.types.ts | 1 - packages/rum-recorder/src/domain/rrweb/mutation.ts | 1 - packages/rum-recorder/src/domain/rrweb/observer.ts | 1 - packages/rum-recorder/src/domain/rrweb/record.ts | 1 - packages/rum-recorder/src/domain/rrweb/utils.ts | 1 - 19 files changed, 3 insertions(+), 29 deletions(-) diff --git a/packages/core/src/browser/fetchProxy.ts b/packages/core/src/browser/fetchProxy.ts index 5d5be39065..fae2711ef8 100644 --- a/packages/core/src/browser/fetchProxy.ts +++ b/packages/core/src/browser/fetchProxy.ts @@ -69,7 +69,6 @@ function proxyFetch() { originalFetch = window.fetch - // eslint-disable @typescript-eslint/promise-function-async window.fetch = monitor(function (this: WindowOrWorkerGlobalScope['fetch'], input: RequestInfo, init?: RequestInit) { const method = (init && init.method) || (typeof input === 'object' && input.method) || 'GET' const url = normalizeUrl((typeof input === 'object' && input.url) || (input as string)) diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index 76a4b0845e..2f5d46c9e4 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -1,4 +1,3 @@ -// eslint-disable @typescript-eslint/ban-types import { combine, Context } from '../tools/context' import { toStackTraceString } from '../tools/error' import * as utils from '../tools/utils' diff --git a/packages/core/src/domain/tracekit.spec.ts b/packages/core/src/domain/tracekit.spec.ts index 4685f6d58c..3a7bac41af 100644 --- a/packages/core/src/domain/tracekit.spec.ts +++ b/packages/core/src/domain/tracekit.spec.ts @@ -20,7 +20,6 @@ describe('TraceKit', () => { expect(stackFrames.stack[0].url).toEqual('http://example.com/js/test.js') expect(stackFrames.stack[0].line).toEqual(63) expect(stackFrames.stack[0].column).toEqual(1) - expect(stackFrames.stack[1].func).toEqual('namedFunc0') expect(stackFrames.stack[1].url).toEqual('http://example.com/js/script.js') expect(stackFrames.stack[1].line).toEqual(10) @@ -110,7 +109,6 @@ Error: foo expect(computeStackTrace(2).message).toBeUndefined() expect(computeStackTrace({ foo: 'bar' }).message).toBeUndefined() expect(computeStackTrace(undefined).message).toBeUndefined() - // eslint-disable-next-line no-null/no-null expect(computeStackTrace(null).message).toBeUndefined() }) }) diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 9a0128fb94..d262091867 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -1,5 +1,3 @@ -// eslint-disable - import { monitor } from './internalMonitoring' export interface BrowserError extends Error { @@ -87,7 +85,6 @@ function isUndefined(what: any) { * @return {Function} The wrapped func * @memberof TraceKit */ -// eslint-disable-next-line @typescript-eslint/ban-types export function wrap(func: Function) { function wrapped(this: any) { try { diff --git a/packages/core/src/domain/tracekitHandler.spec.ts b/packages/core/src/domain/tracekitHandler.spec.ts index 09fa3b4ce3..1f1a152af2 100644 --- a/packages/core/src/domain/tracekitHandler.spec.ts +++ b/packages/core/src/domain/tracekitHandler.spec.ts @@ -1,5 +1,3 @@ -// eslint-disable - import { report, StackFrame, wrap } from './tracekit' describe('Handler', () => { diff --git a/packages/core/src/tools/context.spec.ts b/packages/core/src/tools/context.spec.ts index 8a3ae0c282..cdb6cdbb8c 100644 --- a/packages/core/src/tools/context.spec.ts +++ b/packages/core/src/tools/context.spec.ts @@ -20,12 +20,10 @@ describe('context', () => { }) it('should replace a sub-value with null', () => { - // eslint-disable-next-line no-null/no-null expect(combine({ a: {} }, { a: null as any })).toEqual({ a: null }) }) it('should ignore null arguments', () => { - // eslint-disable-next-line no-null/no-null expect(combine({ a: 1 }, null)).toEqual({ a: 1 }) }) @@ -169,13 +167,13 @@ describe('context', () => { withSnakeCaseKeys({ camelCase: 1, nestedKey: { 'kebab-case': 'helloWorld', array: [{ camelCase: 1 }, { camelCase: 2 }] }, - // eslint-disable-next-line no-null/no-null + nullValue: null, }) ).toEqual({ camel_case: 1, nested_key: { kebab_case: 'helloWorld', array: [{ camel_case: 1 }, { camel_case: 2 }] }, - // eslint-disable-next-line no-null/no-null + null_value: null, }) }) diff --git a/packages/core/src/tools/limitModification.spec.ts b/packages/core/src/tools/limitModification.spec.ts index d5897c3560..2106ae1c1b 100644 --- a/packages/core/src/tools/limitModification.spec.ts +++ b/packages/core/src/tools/limitModification.spec.ts @@ -1,6 +1,5 @@ import { limitModification } from './limitModification' -/* eslint-disable */ describe('limitModification', () => { it('should allow modifications on modifiable field', () => { const object = { foo: { bar: 'bar' }, qux: 'qux' } diff --git a/packages/core/src/tools/utils.spec.ts b/packages/core/src/tools/utils.spec.ts index e2a4e68469..4cf19aeb87 100644 --- a/packages/core/src/tools/utils.spec.ts +++ b/packages/core/src/tools/utils.spec.ts @@ -245,7 +245,6 @@ describe('utils', () => { it('should jsonStringify edge cases', () => { expect(jsonStringify(undefined)).toEqual(undefined) - // eslint-disable-next-line no-null/no-null expect(jsonStringify(null)).toEqual('null') expect(jsonStringify(1)).toEqual('1') expect(jsonStringify(true)).toEqual('true') diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 4c0378d3fa..42c0816aa6 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -188,7 +188,6 @@ function hasToJSON(value: unknown): value is ObjectWithToJSON { export function includes(candidate: string, search: string): boolean export function includes(candidate: T[], search: T): boolean export function includes(candidate: string | unknown[], search: any) { - // eslint-disable-next-line return candidate.indexOf(search) !== -1 } diff --git a/packages/core/test/capturedExceptions.ts b/packages/core/test/capturedExceptions.ts index f1fc503a85..417fed1371 100644 --- a/packages/core/test/capturedExceptions.ts +++ b/packages/core/test/capturedExceptions.ts @@ -1,4 +1,4 @@ -/* eslint-disable max-len */ +/* eslint-disable max-len */ export const OPERA_854 = { message: `Statement on line 44: Type mismatch (usually a non-object value used where an object is required) Backtrace: @@ -384,7 +384,6 @@ export const PHANTOMJS_1_19 = { at http://path/to/file.js:4287`, } -// eslint-disable max-len export const ANDROID_REACT_NATIVE = { message: 'Error: test', name: 'Error', @@ -398,7 +397,6 @@ at child(/home/username/sample-workspace/sampleapp.collect.react/node_modules/re at children(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10) at this(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)\n`, } -// eslint-enable max-len export const ANDROID_REACT_NATIVE_PROD = { message: 'Error: test', diff --git a/packages/rum-core/src/boot/rumPublicApi.spec.ts b/packages/rum-core/src/boot/rumPublicApi.spec.ts index be70de2cc8..c7569a1ca7 100644 --- a/packages/rum-core/src/boot/rumPublicApi.spec.ts +++ b/packages/rum-core/src/boot/rumPublicApi.spec.ts @@ -367,7 +367,6 @@ describe('rum entry', () => { }) it('should sanitize predefined properties', () => { - // eslint-disable-next-line no-null/no-null const user = { id: null, name: 2, email: { bar: 'qux' } } publicApi.setUser(user as any) publicApi.addAction('message') @@ -384,7 +383,6 @@ describe('rum entry', () => { it('should reject non object input', () => { publicApi.setUser(2 as any) - // eslint-disable-next-line no-null/no-null publicApi.setUser(null as any) publicApi.setUser(undefined as any) expect(errorSpy).toHaveBeenCalledTimes(3) diff --git a/packages/rum-core/src/browser/domMutationCollection.spec.ts b/packages/rum-core/src/browser/domMutationCollection.spec.ts index c8bedd926f..e773e35f07 100644 --- a/packages/rum-core/src/browser/domMutationCollection.spec.ts +++ b/packages/rum-core/src/browser/domMutationCollection.spec.ts @@ -95,7 +95,6 @@ describe('domMutationCollection', () => { 'collects DOM mutation when an element is moved', domMutationSpec( (root) => { - // eslint-disable-next-line no-null/no-null root.insertBefore(root.childNodes[0], null) }, { expectedMutations: 1 } diff --git a/packages/rum-core/src/domain/requestCollection.spec.ts b/packages/rum-core/src/domain/requestCollection.spec.ts index 019fc80734..098ce10a68 100644 --- a/packages/rum-core/src/domain/requestCollection.spec.ts +++ b/packages/rum-core/src/domain/requestCollection.spec.ts @@ -57,7 +57,6 @@ describe('collect fetch', () => { afterEach(() => { fetchStubManager.reset() resetFetchProxy() - // eslint-disable-next-line no-null/no-null window.onunhandledrejection = null }) diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts index 36b7766a45..85deaf313a 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/getActionNameFromElement.ts @@ -150,7 +150,6 @@ function truncate(s: string) { function getElementById(refElement: Element, id: string) { // Use the element ownerDocument here, because tests are executed in an iframe, so // document.getElementById won't work. - // eslint-disable-next-line no-null/no-null return refElement.ownerDocument ? refElement.ownerDocument.getElementById(id) : null } diff --git a/packages/rum-core/src/rumEvent.types.ts b/packages/rum-core/src/rumEvent.types.ts index ac4db8264e..43e299fa3a 100644 --- a/packages/rum-core/src/rumEvent.types.ts +++ b/packages/rum-core/src/rumEvent.types.ts @@ -1,4 +1,3 @@ -/* eslint-disable */ /** * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead. */ diff --git a/packages/rum-recorder/src/domain/rrweb/mutation.ts b/packages/rum-recorder/src/domain/rrweb/mutation.ts index b4b61bb213..1a9f41c4f9 100644 --- a/packages/rum-recorder/src/domain/rrweb/mutation.ts +++ b/packages/rum-recorder/src/domain/rrweb/mutation.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-null/no-null */ import { IGNORED_NODE, INode, diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index a57bf3be20..d621d1e907 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-null/no-null */ import { noop } from '@datadog/browser-core' // eslint-disable-next-line import/no-extraneous-dependencies import { FontFaceDescriptors, FontFaceSet } from 'css-font-loading-module' diff --git a/packages/rum-recorder/src/domain/rrweb/record.ts b/packages/rum-recorder/src/domain/rrweb/record.ts index c263e4b380..6498ccdc69 100644 --- a/packages/rum-recorder/src/domain/rrweb/record.ts +++ b/packages/rum-recorder/src/domain/rrweb/record.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-null/no-null */ import { MaskInputOptions, SlimDOMOptions, snapshot } from 'rrweb-snapshot' import { initObservers, mutationBuffer } from './observer' import { Event, EventType, EventWithTime, IncrementalSource, ListenerHandler, RecordOptions } from './types' diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index decf60708d..cd0c699b17 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -18,7 +18,6 @@ export const mirror: Mirror = { return n.__sn.id }, getNode(id) { - // eslint-disable-next-line no-null/no-null return mirror.map[id] || null }, // TODO: use a weakmap to get rid of manually memory management From 30488778f67659046b4724b6ebe5b1a92e4793df Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 14:18:56 +0100 Subject: [PATCH 15/69] Ignore coverage directory --- .eslintignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 24421204c0..71ac8ed945 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,5 @@ bundle cjs esm test/app/dist -./sandbox +sandbox +coverage From 94796df846a346c4402675bd415f2bf9e8a81700 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 14:20:08 +0100 Subject: [PATCH 16/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/array-type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 4 ++-- packages/rum-core/src/rumEvent.types.ts | 1 + test/e2e/lib/framework/pageSetups.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7e789c3e36..f2e945aacd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,6 @@ module.exports = { ], rules: { // Temporary disabled rules - '@typescript-eslint/array-type': 'off', '@typescript-eslint/no-extra-semi': 'off', '@typescript-eslint/require-await': 'off', '@typescript-eslint/await-thenable': 'off', @@ -39,7 +38,6 @@ module.exports = { '@typescript-eslint/prefer-regexp-exec': 'off', '@typescript-eslint/no-inferrable-types': 'off', '@typescript-eslint/no-floating-promises': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/ban-types': [ @@ -79,6 +77,7 @@ module.exports = { 'jsdoc/newline-after-description': 'off', 'unicorn/filename-case': 'off', + '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], 'arrow-body-style': 'error', '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', @@ -113,6 +112,7 @@ module.exports = { '@typescript-eslint/no-misused-promises': 'error', '@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-parameter-properties': 'off', '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', diff --git a/packages/rum-core/src/rumEvent.types.ts b/packages/rum-core/src/rumEvent.types.ts index 43e299fa3a..702025ffe8 100644 --- a/packages/rum-core/src/rumEvent.types.ts +++ b/packages/rum-core/src/rumEvent.types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/array-type */ /** * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead. */ diff --git a/test/e2e/lib/framework/pageSetups.ts b/test/e2e/lib/framework/pageSetups.ts index 8b30bb6531..47be38bd36 100644 --- a/test/e2e/lib/framework/pageSetups.ts +++ b/test/e2e/lib/framework/pageSetups.ts @@ -140,7 +140,7 @@ export function basePage({ header, body }: { header?: string; body?: string }) { } // html is a simple template string tag to allow prettier to format various setups as HTML -export function html(parts: ReadonlyArray, ...vars: string[]) { +export function html(parts: readonly string[], ...vars: string[]) { return parts.reduce((full, part, index) => full + vars[index - 1] + part) } From 2f9a76ab7ea18cd5b655b587c0ddac53c2eaccc8 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 14:52:04 +0100 Subject: [PATCH 17/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-shadow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 5 +++-- packages/core/src/domain/internalMonitoring.ts | 4 ++-- test/e2e/lib/helpers/browser.ts | 6 +++--- webpack.base.js | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f2e945aacd..3d0a17816a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -69,7 +69,6 @@ module.exports = { }, ], 'no-redeclare': 'off', - 'no-shadow': 'off', 'no-throw-literal': 'off', 'no-underscore-dangle': 'off', 'prefer-rest-params': 'off', @@ -77,8 +76,10 @@ module.exports = { 'jsdoc/newline-after-description': 'off', 'unicorn/filename-case': 'off', - '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], 'arrow-body-style': 'error', + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index 2f5d46c9e4..24ecd611bb 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -111,8 +111,8 @@ export function monitor(fn: T): T { logErrorIfDebug(e) try { addErrorToMonitoringBatch(e) - } catch (e) { - logErrorIfDebug(e) + } catch (err) { + logErrorIfDebug(err) } } } as unknown) as T // consider output type has input type diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index 95925ba836..fc925af1dd 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -10,7 +10,7 @@ export async function browserExecuteAsync( ): Promise export async function browserExecuteAsync(fn: (a: A, done: (result: R) => void) => any, arg: A): Promise export async function browserExecuteAsync(fn: (done: (result: R) => void) => any): Promise -export async function browserExecuteAsync(fn: (...args: A) => any, ...args: A) { +export async function browserExecuteAsync(fn: (...params: A) => any, ...args: A) { return browser.executeAsync(fn as any, ...args) } @@ -53,7 +53,7 @@ export async function sendXhr(url: string, headers: string[][] = []): Promise { const xhr = new XMLHttpRequest() xhr.addEventListener('load', () => done({ state: 'success', response: xhr.response as string })) @@ -74,7 +74,7 @@ export async function sendXhr(url: string, headers: string[][] = []): Promise { return browserExecuteAsync( - // tslint:disable-next-line: no-shadowed-variable + // eslint-disable-next-line @typescript-eslint/no-shadow (url, headers, done) => { window .fetch(url, { headers }) diff --git a/webpack.base.js b/webpack.base.js index f97bf2a592..6cdbedf637 100644 --- a/webpack.base.js +++ b/webpack.base.js @@ -50,10 +50,10 @@ module.exports = ({ entry, mode, filename, datacenter }) => ({ plugins: [ new BannerPlugin({ - banner({ filename }) { - const env = filename.match(SUFFIX_REGEXP)[1] - const newFileName = filename.replace(SUFFIX_REGEXP, '') - return `\n${filename} IS DEPRECATED, USE ${newFileName} WITH { site: 'datadoghq.${ + banner({ filename: fileName }) { + const env = fileName.match(SUFFIX_REGEXP)[1] + const newFileName = fileName.replace(SUFFIX_REGEXP, '') + return `\n${fileName} IS DEPRECATED, USE ${newFileName} WITH { site: 'datadoghq.${ env === 'eu' ? 'eu' : 'com' }' } INIT CONFIGURATION INSTEAD\n` }, From ce40fbb07b7a48b3933b1d97aa790545aaf5df6a Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 15:00:23 +0100 Subject: [PATCH 18/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-redeclare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 ++- packages/core/src/boot/init.ts | 2 +- packages/core/src/tools/error.ts | 2 +- packages/logs/src/domain/logger.ts | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3d0a17816a..9c178c695c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -68,7 +68,6 @@ module.exports = { }, }, ], - 'no-redeclare': 'off', 'no-throw-literal': 'off', 'no-underscore-dangle': 'off', 'prefer-rest-params': 'off', @@ -77,7 +76,9 @@ module.exports = { 'unicorn/filename-case': 'off', 'arrow-body-style': 'error', + 'no-redeclare': 'off', 'no-shadow': 'off', + '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/adjacent-overload-signatures': 'error', diff --git a/packages/core/src/boot/init.ts b/packages/core/src/boot/init.ts index 8378cd9263..455fc275f5 100644 --- a/packages/core/src/boot/init.ts +++ b/packages/core/src/boot/init.ts @@ -38,7 +38,7 @@ export const Datacenter = { EU: 'eu', US: 'us', } as const - +// eslint-disable-next-line @typescript-eslint/no-redeclare export type Datacenter = typeof Datacenter[keyof typeof Datacenter] export const INTAKE_SITE = { diff --git a/packages/core/src/tools/error.ts b/packages/core/src/tools/error.ts index 777fe6dfce..c86e098ff7 100644 --- a/packages/core/src/tools/error.ts +++ b/packages/core/src/tools/error.ts @@ -22,7 +22,7 @@ export const ErrorSource = { NETWORK: 'network', SOURCE: 'source', } as const - +// eslint-disable-next-line @typescript-eslint/no-redeclare export type ErrorSource = typeof ErrorSource[keyof typeof ErrorSource] export function formatUnknownError(stackTrace: StackTrace | undefined, errorObject: any, nonErrorPrefix: string) { diff --git a/packages/logs/src/domain/logger.ts b/packages/logs/src/domain/logger.ts index 806a8cea76..b25b9439b1 100644 --- a/packages/logs/src/domain/logger.ts +++ b/packages/logs/src/domain/logger.ts @@ -6,7 +6,7 @@ export const StatusType = { info: 'info', warn: 'warn', } as const - +// eslint-disable-next-line @typescript-eslint/no-redeclare export type StatusType = typeof StatusType[keyof typeof StatusType] const STATUS_PRIORITIES: { [key in StatusType]: number } = { @@ -29,7 +29,7 @@ export const HandlerType = { http: 'http', silent: 'silent', } as const - +// eslint-disable-next-line @typescript-eslint/no-redeclare export type HandlerType = typeof HandlerType[keyof typeof HandlerType] export class Logger { From bbb9b45a7aa34ef7c704e1c76c9a9c72eced3a4e Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 15:04:32 +0100 Subject: [PATCH 19/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20no-throw-lite?= =?UTF-8?q?ral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/domain/internalMonitoring.spec.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9c178c695c..027ea6d7d8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -68,7 +68,6 @@ module.exports = { }, }, ], - 'no-throw-literal': 'off', 'no-underscore-dangle': 'off', 'prefer-rest-params': 'off', 'jsdoc/check-indentation': 'off', @@ -78,6 +77,7 @@ module.exports = { 'arrow-body-style': 'error', 'no-redeclare': 'off', 'no-shadow': 'off', + 'no-throw-literal': 'error', '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], diff --git a/packages/core/src/domain/internalMonitoring.spec.ts b/packages/core/src/domain/internalMonitoring.spec.ts index b21343d4e3..b0cafabe0d 100644 --- a/packages/core/src/domain/internalMonitoring.spec.ts +++ b/packages/core/src/domain/internalMonitoring.spec.ts @@ -38,6 +38,7 @@ describe('internal monitoring', () => { @monitored monitoredObjectErrorThrowing() { + // eslint-disable-next-line no-throw-literal throw { foo: 'bar' } } From 0afa54e45c351701fff768821054521c2cd7548d Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 15:37:26 +0100 Subject: [PATCH 20/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20unicorn/filen?= =?UTF-8?q?ame-case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 10 +++++++++- test/e2e/{ts-node.js => tsNode.js} | 0 test/e2e/wdio.base.conf.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) rename test/e2e/{ts-node.js => tsNode.js} (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 027ea6d7d8..87be162e6f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -72,8 +72,8 @@ module.exports = { 'prefer-rest-params': 'off', 'jsdoc/check-indentation': 'off', 'jsdoc/newline-after-description': 'off', - 'unicorn/filename-case': 'off', + 'unicorn/filename-case': ['error', { case: 'camelCase' }], 'arrow-body-style': 'error', 'no-redeclare': 'off', 'no-shadow': 'off', @@ -226,4 +226,12 @@ module.exports = { 'use-isnan': 'error', 'valid-typeof': 'off', }, + overrides: [ + { + files: ['scripts/*.js'], + rules: { + 'unicorn/filename-case': ['error', { case: 'kebabCase' }], + }, + }, + ], } diff --git a/test/e2e/ts-node.js b/test/e2e/tsNode.js similarity index 100% rename from test/e2e/ts-node.js rename to test/e2e/tsNode.js diff --git a/test/e2e/wdio.base.conf.js b/test/e2e/wdio.base.conf.js index cd0361a5a9..f109d13380 100644 --- a/test/e2e/wdio.base.conf.js +++ b/test/e2e/wdio.base.conf.js @@ -33,7 +33,7 @@ module.exports = { reporters, jasmineNodeOpts: { defaultTimeoutInterval: 60000, - requires: [path.resolve(__dirname, './ts-node')], + requires: [path.resolve(__dirname, './tsNode')], }, onPrepare() { if (testReportDirectory) { From 10df551063eede080e0ec67829f95b2d4393fd25 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 15:43:47 +0100 Subject: [PATCH 21/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20jsdoc/check-i?= =?UTF-8?q?ndentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/domain/tracekit.ts | 10 +++++----- packages/core/src/tools/utils.ts | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 87be162e6f..59aaacaee9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -70,10 +70,10 @@ module.exports = { ], 'no-underscore-dangle': 'off', 'prefer-rest-params': 'off', - 'jsdoc/check-indentation': 'off', 'jsdoc/newline-after-description': 'off', 'unicorn/filename-case': ['error', { case: 'camelCase' }], + 'jsdoc/check-indentation': 'error', 'arrow-body-style': 'error', 'no-redeclare': 'off', 'no-shadow': 'off', diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index d262091867..554445e884 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -384,10 +384,10 @@ export const report = (function reportModuleWrapper() { * computeStackTrace: cross-browser stack traces in JavaScript * * Syntax: - * ```js - * s = computeStackTrace.ofCaller([depth]) - * s = computeStackTrace(exception) // consider using report instead (see below) - * ``` + * ```js + * s = computeStackTrace.ofCaller([depth]) + * s = computeStackTrace(exception) // consider using report instead (see below) + * ``` * * Supports: * - Firefox: full stack trace with line numbers and unreliable column @@ -426,7 +426,7 @@ export const report = (function reportModuleWrapper() { * inner function that actually caused the exception). * * Tracing example: - * ```js + * ```js * function trace(message) { * let stackInfo = computeStackTrace.ofCaller(); * let data = message + "\n"; diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 42c0816aa6..94d292231b 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -344,8 +344,8 @@ interface AddEventListenerOptions { * a few conveniences compared to using `element.addEventListener` directly: * * * supports IE11 by: - * * using an option object only if needed - * * emulating the `once` option + * - using an option object only if needed + * - emulating the `once` option * * * wraps the listener with a `monitor` function * @@ -365,15 +365,14 @@ export function addEventListener( * a few conveniences compared to using `element.addEventListener` directly: * * * supports IE11 by: - * * using an option object only if needed - * * emulating the `once` option + * - using an option object only if needed + * - emulating the `once` option * * * wraps the listener with a `monitor` function * * * returns a `stop` function to remove the listener * - * * with `once: true`, the listener will be called at most once, even if different events are - * listened + * * with `once: true`, the listener will be called at most once, even if different events are listened */ export function addEventListeners( emitter: EventEmitter, From 75f654ea298d1df597421057cd5ea8e61c49003e Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 15:56:53 +0100 Subject: [PATCH 22/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/await-thenable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 5 +++-- scripts/generate-schema-types.js | 2 +- test/e2e/lib/helpers/browser.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 59aaacaee9..cfe3a2e50b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,9 +22,7 @@ module.exports = { ], rules: { // Temporary disabled rules - '@typescript-eslint/no-extra-semi': 'off', '@typescript-eslint/require-await': 'off', - '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-unsafe-call': 'off', @@ -80,10 +78,12 @@ module.exports = { 'no-throw-literal': 'error', '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/no-extra-semi': 'off', '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-member-accessibility': [ 'off', @@ -105,6 +105,7 @@ module.exports = { }, }, ], + '@typescript-eslint/indent': 'off', '@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-explicit-any': 'off', diff --git a/scripts/generate-schema-types.js b/scripts/generate-schema-types.js index f530df3a42..f95b8219d1 100644 --- a/scripts/generate-schema-types.js +++ b/scripts/generate-schema-types.js @@ -18,7 +18,7 @@ async function main() { style: prettierConfig, }) console.log(`writing ${compiledTypesPath}`) - await fs.writeFileSync(compiledTypesPath, compiledTypes) + fs.writeFileSync(compiledTypesPath, compiledTypes) console.log('done') } diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index fc925af1dd..a1a0ab2d1b 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -27,7 +27,7 @@ export async function withBrowserLogs(fn: (logs: BrowserLog[]) => void) { // https://github.com/webdriverio/webdriverio/issues/4275 if (browser.getLogs) { const logs = (await browser.getLogs('browser')) as BrowserLog[] - await fn(logs) + fn(logs) } } From 6420b6283f62f31e5a9dc5d561cfa3c70939708b Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 18:16:29 +0100 Subject: [PATCH 23/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-unused-vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/browser/xhrProxy.ts | 2 +- packages/core/src/domain/tracekit.ts | 12 +++--------- packages/core/src/tools/specHelper.ts | 4 ++-- packages/core/src/transport/transport.ts | 1 - packages/rum-core/src/boot/rum.ts | 4 ++-- .../rum-core/src/domain/requestCollection.spec.ts | 4 +--- .../longTask/longTaskCollection.spec.ts | 4 ++-- .../longTask/longTaskCollection.ts | 4 ++-- .../domain/rumEventsCollection/view/trackViews.ts | 11 +---------- .../rumEventsCollection/view/viewCollection.spec.ts | 2 +- packages/rum-recorder/src/domain/rrweb/observer.ts | 2 +- packages/rum-recorder/src/domain/rrweb/utils.ts | 2 +- test/e2e/lib/framework/sdkBuilds.ts | 2 +- 14 files changed, 19 insertions(+), 37 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cfe3a2e50b..dce70dba51 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,6 @@ module.exports = { // Temporary disabled rules '@typescript-eslint/require-await': 'off', '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/member-ordering': 'off', @@ -85,6 +84,7 @@ module.exports = { '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/no-extra-semi': 'off', '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/explicit-member-accessibility': [ 'off', { diff --git a/packages/core/src/browser/xhrProxy.ts b/packages/core/src/browser/xhrProxy.ts index 5ada2a440f..e3d7f2195b 100644 --- a/packages/core/src/browser/xhrProxy.ts +++ b/packages/core/src/browser/xhrProxy.ts @@ -80,7 +80,7 @@ function proxyXhr() { return originalXhrOpen.apply(this, arguments as any) }) - XMLHttpRequest.prototype.send = monitor(function (this: BrowserXHR, body: unknown) { + XMLHttpRequest.prototype.send = monitor(function (this: BrowserXHR) { if (this._datadog_xhr) { this._datadog_xhr.startTime = performance.now() diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 554445e884..5e833d24a1 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -226,7 +226,7 @@ export const report = (function reportModuleWrapper() { let stack: StackTrace if (lastExceptionStack) { - computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, `${message}`) + computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo) processLastException() } else if (errorObj) { stack = computeStackTrace(errorObj) @@ -768,12 +768,7 @@ export const computeStackTrace = (function computeStackTraceWrapper() { * augmented. * @memberof computeStackTrace */ - function augmentStackTraceWithInitialElement( - stackInfo: StackTrace, - url?: string, - lineNo?: string | number, - message?: string - ) { + function augmentStackTraceWithInitialElement(stackInfo: StackTrace, url?: string, lineNo?: string | number) { const initial: StackFrame = { url, line: lineNo ? +lineNo : undefined, @@ -869,8 +864,7 @@ export const computeStackTrace = (function computeStackTraceWrapper() { augmentStackTraceWithInitialElement( result, tryToGetString(ex, 'sourceURL') || tryToGetString(ex, 'fileName'), - tryToGetString(ex, 'line') || tryToGetString(ex, 'lineNumber'), - tryToGetString(ex, 'message') || tryToGetString(ex, 'description') + tryToGetString(ex, 'line') || tryToGetString(ex, 'lineNumber') ) return result } diff --git a/packages/core/src/tools/specHelper.ts b/packages/core/src/tools/specHelper.ts index 71479a79a1..7bdcfc9777 100644 --- a/packages/core/src/tools/specHelper.ts +++ b/packages/core/src/tools/specHelper.ts @@ -122,10 +122,10 @@ class StubXhr { this.fakeEventTarget = document.createElement('div') } - /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ + /* eslint-disable no-empty,@typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars */ open(method: string, url: string) {} send() {} - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ + /* eslint-enable no-empty,@typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars */ abort() { this.status = 0 diff --git a/packages/core/src/transport/transport.ts b/packages/core/src/transport/transport.ts index 19fcadd0e8..ce789ff4f1 100644 --- a/packages/core/src/transport/transport.ts +++ b/packages/core/src/transport/transport.ts @@ -1,4 +1,3 @@ -import { monitor } from '../domain/internalMonitoring' import { Context } from '../tools/context' import { addEventListener, DOM_EVENT, jsonStringify, noop, objectValues } from '../tools/utils' diff --git a/packages/rum-core/src/boot/rum.ts b/packages/rum-core/src/boot/rum.ts index 3a7d3a2bf4..41146c3069 100644 --- a/packages/rum-core/src/boot/rum.ts +++ b/packages/rum-core/src/boot/rum.ts @@ -1,4 +1,4 @@ -import { combine, commonInit, Configuration, Context } from '@datadog/browser-core' +import { combine, commonInit, Configuration } from '@datadog/browser-core' import { startDOMMutationCollection } from '../browser/domMutationCollection' import { startPerformanceCollection } from '../browser/performanceCollection' import { startRumAssembly } from '../domain/assembly' @@ -69,7 +69,7 @@ export function startRumEventCollection( const parentContexts = startParentContexts(lifeCycle, session) const batch = startRumBatch(configuration, lifeCycle) startRumAssembly(applicationId, configuration, lifeCycle, session, parentContexts, getCommonContext) - startLongTaskCollection(lifeCycle, configuration) + startLongTaskCollection(lifeCycle) startResourceCollection(lifeCycle, configuration, session) const { addTiming } = startViewCollection(lifeCycle, configuration, location) const { addError } = startErrorCollection(lifeCycle, configuration) diff --git a/packages/rum-core/src/domain/requestCollection.spec.ts b/packages/rum-core/src/domain/requestCollection.spec.ts index 098ce10a68..5274138ec3 100644 --- a/packages/rum-core/src/domain/requestCollection.spec.ts +++ b/packages/rum-core/src/domain/requestCollection.spec.ts @@ -1,7 +1,6 @@ import { Configuration, DEFAULT_CONFIGURATION, - FetchProxy, FetchStub, FetchStubManager, isIE, @@ -27,7 +26,6 @@ describe('collect fetch', () => { const FAKE_URL = 'http://fake-url/' let fetchStub: FetchStub let fetchStubManager: FetchStubManager - let fetchProxy: FetchProxy let startSpy: jasmine.Spy<(requestStartEvent: RequestStartEvent) => void> let completeSpy: jasmine.Spy<(requestCompleteEvent: RequestCompleteEvent) => void> @@ -46,7 +44,7 @@ describe('collect fetch', () => { clearTracingIfCancelled, traceFetch: () => undefined, } - fetchProxy = trackFetch(lifeCycle, configuration as Configuration, tracerStub as Tracer) + trackFetch(lifeCycle, configuration as Configuration, tracerStub as Tracer) fetchStub = window.fetch as FetchStub window.onunhandledrejection = (ev: PromiseRejectionEvent) => { diff --git a/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.spec.ts index 04352c0d56..c0d5afe319 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.spec.ts @@ -12,8 +12,8 @@ describe('long task collection', () => { .withConfiguration({ isEnabled: () => true, }) - .beforeBuild(({ lifeCycle, configuration }) => { - startLongTaskCollection(lifeCycle, configuration) + .beforeBuild(({ lifeCycle }) => { + startLongTaskCollection(lifeCycle) }) }) diff --git a/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.ts b/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.ts index 8417fb4160..9a2297d283 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/longTask/longTaskCollection.ts @@ -1,8 +1,8 @@ -import { Configuration, getTimestamp, msToNs } from '@datadog/browser-core' +import { getTimestamp, msToNs } from '@datadog/browser-core' import { RawRumLongTaskEvent, RumEventType } from '../../../rawRumEvent.types' import { LifeCycle, LifeCycleEventType } from '../../lifeCycle' -export function startLongTaskCollection(lifeCycle: LifeCycle, configuration: Configuration) { +export function startLongTaskCollection(lifeCycle: LifeCycle) { lifeCycle.subscribe(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, (entry) => { if (entry.entryType !== 'longtask') { return diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts index aded24616b..9498c065d9 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts @@ -1,13 +1,4 @@ -import { - addEventListener, - DOM_EVENT, - generateUUID, - monitor, - msToNs, - noop, - ONE_MINUTE, - throttle, -} from '@datadog/browser-core' +import { addEventListener, DOM_EVENT, generateUUID, monitor, noop, ONE_MINUTE, throttle } from '@datadog/browser-core' import { supportPerformanceTimingEvent } from '../../../browser/performanceCollection' import { LifeCycle, LifeCycleEventType } from '../../lifeCycle' diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/viewCollection.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/view/viewCollection.spec.ts index 2566d79228..3baa7c101b 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/viewCollection.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/viewCollection.spec.ts @@ -1,7 +1,7 @@ import { setup, TestSetupBuilder } from '../../../../test/specHelper' import { RumEventType } from '../../../rawRumEvent.types' import { LifeCycleEventType } from '../../lifeCycle' -import { View, ViewLoadingType } from './trackViews' +import { ViewLoadingType } from './trackViews' import { startViewCollection } from './viewCollection' describe('viewCollection', () => { diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index d621d1e907..47423287ca 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -100,7 +100,7 @@ function initMoveObserver(cb: MousemoveCallBack, sampling: SamplingStrategy): Li x: clientX, y: clientY, }) - wrappedCb(isTouchEvent(evt)) + wrappedCb() }, threshold, { diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index cd0c699b17..1f1811f030 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -37,7 +37,7 @@ export const mirror: Mirror = { export function throttle(func: (arg: T) => void, wait: number, options: ThrottleOptions = {}) { let timeout: number | undefined let previous = 0 - return function (this: unknown, _: T) { + return function (this: unknown) { const now = Date.now() if (!previous && options.leading === false) { previous = now diff --git a/test/e2e/lib/framework/sdkBuilds.ts b/test/e2e/lib/framework/sdkBuilds.ts index 617a79bf62..4690e5e6f7 100644 --- a/test/e2e/lib/framework/sdkBuilds.ts +++ b/test/e2e/lib/framework/sdkBuilds.ts @@ -44,7 +44,7 @@ function bufferReplace(buffer: Buffer, replacements: { [placeholder: string]: st const parts = [] let lastIndex = 0 for (let index = 0; index < buffer.length; index += 1) { - const found = replacementsArray.find(([placeholder, _]) => + const found = replacementsArray.find(([placeholder]) => buffer.slice(index, index + placeholder.length).equals(placeholder) ) if (found) { From 2d7f5bddfc3cad11f649eecdc758df298e6db914 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 18 Jan 2021 18:22:16 +0100 Subject: [PATCH 24/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/ban-ts-comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 10 +++++++++- packages/core/src/tools/utils.ts | 4 ++-- packages/rum-recorder/src/domain/rrweb/mutation.ts | 14 +++++++------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index dce70dba51..e24bea8545 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,7 +23,6 @@ module.exports = { rules: { // Temporary disabled rules '@typescript-eslint/require-await': 'off', - '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/member-ordering': 'off', @@ -75,6 +74,15 @@ module.exports = { 'no-redeclare': 'off', 'no-shadow': 'off', 'no-throw-literal': 'error', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': 'allow-with-description', + 'ts-nocheck': 'allow-with-description', + 'ts-check': 'allow-with-description', + }, + ], '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/await-thenable': 'error', diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 94d292231b..347509c7b8 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -272,9 +272,9 @@ export function getGlobalObject(): T { }, configurable: true, }) - // @ts-ignore + // @ts-ignore _dd_temp is defined using defineProperty let globalObject: unknown = _dd_temp_ - // @ts-ignore + // @ts-ignore _dd_temp is defined using defineProperty delete Object.prototype._dd_temp_ if (typeof globalObject !== 'object') { // on safari _dd_temp_ is available on window but not globally diff --git a/packages/rum-recorder/src/domain/rrweb/mutation.ts b/packages/rum-recorder/src/domain/rrweb/mutation.ts index 1a9f41c4f9..149038ae1f 100644 --- a/packages/rum-recorder/src/domain/rrweb/mutation.ts +++ b/packages/rum-recorder/src/domain/rrweb/mutation.ts @@ -141,19 +141,19 @@ export class MutationBuffer { private movedSet = new Set() private droppedSet = new Set() - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private emissionCallback: MutationCallBack - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private blockClass: BlockClass - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private blockSelector: string | null - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private inlineStylesheet: boolean - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private maskInputOptions: MaskInputOptions - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private recordCanvas: boolean - // @ts-ignore + // @ts-ignore Allows creating an instance without initializing all fields private slimDOMOptions: SlimDOMOptions public init( From ed14e2b306a42529e242dc1f12c36fbe97ee35f8 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 19 Jan 2021 10:27:22 +0100 Subject: [PATCH 25/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-unsafe-call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 8 +++++++- packages/core/src/domain/tracekit.ts | 2 +- packages/logs/src/domain/logger.spec.ts | 3 +-- packages/logs/src/domain/logger.ts | 2 +- packages/rum-core/src/boot/rumPublicApi.spec.ts | 2 +- rum-events-format | 2 +- test/app/app.ts | 3 +++ 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e24bea8545..6e12ce8d2b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,7 +23,6 @@ module.exports = { rules: { // Temporary disabled rules '@typescript-eslint/require-await': 'off', - '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/member-ordering': 'off', '@typescript-eslint/no-for-in-array': 'off', @@ -74,6 +73,7 @@ module.exports = { 'no-redeclare': 'off', 'no-shadow': 'off', 'no-throw-literal': 'error', + '@typescript-eslint/no-unsafe-call': 'error', '@typescript-eslint/ban-ts-comment': [ 'error', { @@ -242,5 +242,11 @@ module.exports = { 'unicorn/filename-case': ['error', { case: 'kebabCase' }], }, }, + { + files: ['**/*.js'], + rules: { + '@typescript-eslint/no-unsafe-call': 'off', + }, + }, ], } diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 5e833d24a1..6a97062b49 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -970,7 +970,7 @@ export const computeStackTrace = (function computeStackTraceWrapper() { */ export function extendToAsynchronousCallbacks() { function helper(fnName: any) { - const originalFn = (window as any)[fnName] + const originalFn = (window as any)[fnName] as (...args: any[]) => any ;(window as any)[fnName] = function traceKitAsyncExtension() { // Make a copy of the arguments const args: any[] = [].slice.call(arguments) diff --git a/packages/logs/src/domain/logger.spec.ts b/packages/logs/src/domain/logger.spec.ts index 9aa030c323..64531a061f 100644 --- a/packages/logs/src/domain/logger.spec.ts +++ b/packages/logs/src/domain/logger.spec.ts @@ -22,8 +22,7 @@ describe('Logger', () => { STATUSES.forEach((status) => { it(`'logger.${status}' should have ${status} status`, () => { - ;(logger as any)[status]('message') - + logger[status]('message') expect(getLoggedMessage(0).status).toEqual(status) }) }) diff --git a/packages/logs/src/domain/logger.ts b/packages/logs/src/domain/logger.ts index b25b9439b1..593d4a913d 100644 --- a/packages/logs/src/domain/logger.ts +++ b/packages/logs/src/domain/logger.ts @@ -16,7 +16,7 @@ const STATUS_PRIORITIES: { [key in StatusType]: number } = { [StatusType.error]: 3, } -export const STATUSES = Object.keys(StatusType) +export const STATUSES = Object.keys(StatusType) as StatusType[] export interface LogsMessage { message: string diff --git a/packages/rum-core/src/boot/rumPublicApi.spec.ts b/packages/rum-core/src/boot/rumPublicApi.spec.ts index c7569a1ca7..9bdc95c276 100644 --- a/packages/rum-core/src/boot/rumPublicApi.spec.ts +++ b/packages/rum-core/src/boot/rumPublicApi.spec.ts @@ -415,7 +415,7 @@ describe('rum entry', () => { it('should add custom timings', () => { rumGlobal.init(DEFAULT_INIT_CONFIGURATION) - // tslint:disable-next-line: no-unsafe-any + // eslint-disable-next-line @typescript-eslint/no-unsafe-call ;(rumGlobal as any).addTiming('foo') expect(addTimingSpy.calls.argsFor(0)[0]).toEqual('foo') expect(errorSpy).not.toHaveBeenCalled() diff --git a/rum-events-format b/rum-events-format index f59022e0a2..e15afe458d 160000 --- a/rum-events-format +++ b/rum-events-format @@ -1 +1 @@ -Subproject commit f59022e0a2c13101c6ed9fa5101d6f87af4c50ca +Subproject commit e15afe458daee62dc7fae3fc061c48097bb8612a diff --git a/test/app/app.ts b/test/app/app.ts index 054096c853..993d55bd44 100644 --- a/test/app/app.ts +++ b/test/app/app.ts @@ -8,6 +8,9 @@ declare global { } } +// ESLint cannot infer typing for datadogLogs and datadogRum +/* eslint-disable @typescript-eslint/no-unsafe-call */ + if (typeof window !== 'undefined') { if (window.LOGS_CONFIG) { datadogLogs.init(window.LOGS_CONFIG) From 95a57e0e3cc0ec90b5bbbed2629cd51efc6c6a45 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 19 Jan 2021 10:39:52 +0100 Subject: [PATCH 26/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-for-in-array?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/domain/tracekit.ts | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6e12ce8d2b..2f43940b3c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,6 @@ module.exports = { '@typescript-eslint/require-await': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/member-ordering': 'off', - '@typescript-eslint/no-for-in-array': 'off', '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/naming-convention': 'off', @@ -88,6 +87,7 @@ module.exports = { '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/no-for-in-array': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/no-extra-semi': 'off', diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 6a97062b49..ed1941650c 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -185,16 +185,13 @@ export const report = (function reportModuleWrapper() { */ function notifyHandlers(stack: StackTrace, isWindowError: boolean, error?: any) { let exception - for (const i in handlers) { - if (has(handlers, i)) { - try { - handlers[i](stack, isWindowError, error) - } catch (inner) { - exception = inner - } + handlers.forEach((handler) => { + try { + handler(stack, isWindowError, error) + } catch (inner) { + exception = inner } - } - + }) if (exception) { throw exception } From a3b30ffe9b73a82d88b306216ad04267d2834957 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 19 Jan 2021 11:01:09 +0100 Subject: [PATCH 27/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/member-ordering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 49 ++++++++++++++++++- .../src/domain/internalMonitoring.spec.ts | 8 +-- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2f43940b3c..44c64c4d94 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,6 @@ module.exports = { // Temporary disabled rules '@typescript-eslint/require-await': 'off', '@typescript-eslint/unbound-method': 'off', - '@typescript-eslint/member-ordering': 'off', '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/naming-convention': 'off', @@ -82,6 +81,54 @@ module.exports = { 'ts-check': 'allow-with-description', }, ], + '@typescript-eslint/member-ordering': [ + 'error', + { + default: { + memberTypes: [ + // Index signature + 'signature', + + // Static Fields + 'public-static-field', + 'protected-static-field', + 'private-static-field', + // Instance Fields + 'public-decorated-field', + 'public-instance-field', + 'public-abstract-field', + 'protected-decorated-field', + 'protected-instance-field', + 'protected-abstract-field', + 'private-decorated-field', + 'private-instance-field', + 'private-abstract-field', + + // Constructors + 'public-constructor', + 'protected-constructor', + 'private-constructor', + + // Static Methods + 'public-static-method', + 'protected-static-method', + 'private-static-method', + + // Instance Methods + 'public-decorated-method', + 'public-instance-method', + 'public-abstract-method', + 'protected-decorated-method', + 'protected-instance-method', + 'protected-abstract-method', + 'private-decorated-method', + 'private-instance-method', + 'private-abstract-method', + ], + order: 'as-written', + }, + }, + ], '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/await-thenable': 'error', diff --git a/packages/core/src/domain/internalMonitoring.spec.ts b/packages/core/src/domain/internalMonitoring.spec.ts index b0cafabe0d..9fe8c52fbe 100644 --- a/packages/core/src/domain/internalMonitoring.spec.ts +++ b/packages/core/src/domain/internalMonitoring.spec.ts @@ -21,10 +21,6 @@ const configuration: Partial = { describe('internal monitoring', () => { describe('decorator', () => { class Candidate { - notMonitoredThrowing() { - throw new Error('not monitored') - } - @monitored monitoredThrowing() { throw new Error('monitored') @@ -46,6 +42,10 @@ describe('internal monitoring', () => { monitoredNotThrowing() { return 1 } + + notMonitoredThrowing() { + throw new Error('not monitored') + } } let candidate: Candidate From 187c5419aebdecd5823d3d90118c3c3d9661d92f Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 19 Jan 2021 11:06:21 +0100 Subject: [PATCH 28/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-var-requires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 44c64c4d94..8d0114467a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,7 @@ module.exports = { // Temporary disabled rules '@typescript-eslint/require-await': 'off', '@typescript-eslint/unbound-method': 'off', - '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-empty-interface': 'off', @@ -293,6 +293,7 @@ module.exports = { files: ['**/*.js'], rules: { '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-var-requires': 'off', }, }, ], From aa055e023fb58bd8fec0fc370058f89a7d02a39c Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 19 Jan 2021 19:27:04 +0100 Subject: [PATCH 29/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-unsafe-return?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 ++- .../core/src/domain/internalMonitoring.ts | 24 +++++++++++-------- packages/core/src/domain/tracekit.ts | 9 ++++--- .../core/src/domain/tracekitHandler.spec.ts | 2 +- packages/core/src/tools/utils.ts | 2 +- packages/logs/src/boot/logs.entry.spec.ts | 2 +- .../src/browser/performanceCollection.ts | 4 +++- .../view/trackViews.spec.ts | 2 +- .../src/domain/trackPageActivities.spec.ts | 4 ++-- test/e2e/lib/framework/createTest.ts | 2 +- test/e2e/lib/helpers/browser.ts | 1 + 11 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8d0114467a..22f672c875 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,7 @@ module.exports = { '@typescript-eslint/require-await': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/no-var-requires': 'error', - '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/prefer-regexp-exec': 'off', @@ -293,6 +293,7 @@ module.exports = { files: ['**/*.js'], rules: { '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-var-requires': 'off', }, }, diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index 24ecd611bb..2d20ff5799 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -95,18 +95,22 @@ export function resetInternalMonitoring() { monitoringConfiguration.batch = undefined } -export function monitored(_: any, __: string, descriptor: PropertyDescriptor) { - const originalMethod = descriptor.value - descriptor.value = function () { - const decorated = (monitoringConfiguration.batch ? monitor(originalMethod) : originalMethod) as Function - return decorated.apply(this, arguments) - } +export function monitored unknown>( + _: any, + __: string, + descriptor: TypedPropertyDescriptor +) { + const originalMethod = descriptor.value! + descriptor.value = (function (this: any, ...args: Parameters) { + const decorated = monitoringConfiguration.batch ? monitor(originalMethod) : originalMethod + return decorated.apply(this, args) as ReturnType + } as any) as T } -export function monitor(fn: T): T { - return (function (this: any) { +export function monitor(fn: (...args: any[]) => R) { + return (function (this: any, ...args: any[]) { try { - return fn.apply(this, arguments) + return fn.apply(this, args) } catch (e) { logErrorIfDebug(e) try { @@ -115,7 +119,7 @@ export function monitor(fn: T): T { logErrorIfDebug(err) } } - } as unknown) as T // consider output type has input type + } as unknown) as (...args: any[]) => R // consider output type has input type } export function addMonitoringMessage(message: string, context?: Context) { diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index ed1941650c..7b712626a7 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -85,10 +85,10 @@ function isUndefined(what: any) { * @return {Function} The wrapped func * @memberof TraceKit */ -export function wrap(func: Function) { - function wrapped(this: any) { +export function wrap(func: (...args: Args) => R) { + function wrapped(this: any, ...args: Args) { try { - return func.apply(this, arguments) + return func.apply(this, args) } catch (e) { report(e) throw e @@ -255,6 +255,7 @@ export const report = (function reportModuleWrapper() { } if (oldOnerrorHandler) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return oldOnerrorHandler.apply(this, arguments as any) } @@ -979,8 +980,10 @@ export function extendToAsynchronousCallbacks() { // also only supports 2 argument and doesn't care what "this" is, so we // can just call the original function directly. if (originalFn.apply) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return originalFn.apply(this, args) } + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return originalFn(args[0], args[1]) } } diff --git a/packages/core/src/domain/tracekitHandler.spec.ts b/packages/core/src/domain/tracekitHandler.spec.ts index 1f1a152af2..69ef4ffcb2 100644 --- a/packages/core/src/domain/tracekitHandler.spec.ts +++ b/packages/core/src/domain/tracekitHandler.spec.ts @@ -13,7 +13,7 @@ describe('Handler', () => { } report.subscribe(handler) - expect(() => wrap(throwException)()).toThrowError() + expect((): void => wrap(throwException)()).toThrowError() setTimeout(() => { report.unsubscribe(handler) diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 347509c7b8..8c77072895 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -268,7 +268,7 @@ export function getGlobalObject(): T { } Object.defineProperty(Object.prototype, '_dd_temp_', { get() { - return this + return this as object }, configurable: true, }) diff --git a/packages/logs/src/boot/logs.entry.spec.ts b/packages/logs/src/boot/logs.entry.spec.ts index 01efb310ea..89b9523db5 100644 --- a/packages/logs/src/boot/logs.entry.spec.ts +++ b/packages/logs/src/boot/logs.entry.spec.ts @@ -15,7 +15,7 @@ describe('logs entry', () => { let startLogsGetGlobalContext: (() => Context) | undefined const startLogs: StartLogs = (configuration, logger, getGlobalContext) => { startLogsGetGlobalContext = getGlobalContext - return sendLogsSpy as any + return (sendLogsSpy as any) as ReturnType } function getLoggedMessage(index: number) { diff --git a/packages/rum-core/src/browser/performanceCollection.ts b/packages/rum-core/src/browser/performanceCollection.ts index 48a3d4d629..13f171185a 100644 --- a/packages/rum-core/src/browser/performanceCollection.ts +++ b/packages/rum-core/src/browser/performanceCollection.ts @@ -105,7 +105,9 @@ export function startPerformanceCollection(lifeCycle: LifeCycle, configuration: } if ((window as BrowserWindow).PerformanceObserver) { const observer = new PerformanceObserver( - monitor((entries) => handlePerformanceEntries(lifeCycle, configuration, entries.getEntries())) + monitor((entries: PerformanceObserverEntryList) => + handlePerformanceEntries(lifeCycle, configuration, entries.getEntries()) + ) ) const entryTypes = [ 'resource', diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts index 23c410ad83..45bdae3b02 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.spec.ts @@ -52,7 +52,7 @@ const FAKE_NAVIGATION_ENTRY_WITH_LOADEVENT_AFTER_ACTIVITY_TIMING: RumPerformance } function mockGetElementById() { - const fakeGetElementById = (elementId: string) => (elementId === ('testHashValue' as unknown)) as any + const fakeGetElementById = (elementId: string) => ((elementId === 'testHashValue') as any) as HTMLElement return spyOn(document, 'getElementById').and.callFake(fakeGetElementById) } diff --git a/packages/rum-core/src/domain/trackPageActivities.spec.ts b/packages/rum-core/src/domain/trackPageActivities.spec.ts index 34efb5a245..f586b532ea 100644 --- a/packages/rum-core/src/domain/trackPageActivities.spec.ts +++ b/packages/rum-core/src/domain/trackPageActivities.spec.ts @@ -102,8 +102,8 @@ describe('trackPagePageActivities', () => { }) describe('requests', () => { - function makeFakeRequestCompleteEvent(requestIndex: number): RequestCompleteEvent { - return { requestIndex } as any + function makeFakeRequestCompleteEvent(requestIndex: number) { + return ({ requestIndex } as any) as RequestCompleteEvent } it('emits an activity event when a request starts', () => { const lifeCycle = new LifeCycle() diff --git a/test/e2e/lib/framework/createTest.ts b/test/e2e/lib/framework/createTest.ts index 59083eca16..8a0296dee0 100644 --- a/test/e2e/lib/framework/createTest.ts +++ b/test/e2e/lib/framework/createTest.ts @@ -120,7 +120,7 @@ function declareTest(title: string, setup: string, runner: TestRunner) { function getBrowserName() { const capabilities = browser.options.capabilities - return capabilities && (capabilities.browserName || (capabilities as any).browser) + return capabilities && ((capabilities.browserName || (capabilities as any).browser) as string) } function createTestContext(servers: Servers): TestContext { diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index a1a0ab2d1b..dadc292aeb 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -11,6 +11,7 @@ export async function browserExecuteAsync( export async function browserExecuteAsync(fn: (a: A, done: (result: R) => void) => any, arg: A): Promise export async function browserExecuteAsync(fn: (done: (result: R) => void) => any): Promise export async function browserExecuteAsync(fn: (...params: A) => any, ...args: A) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return browser.executeAsync(fn as any, ...args) } From 8006b2e85a56be106498c7305409fc800726002d Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Wed, 20 Jan 2021 15:00:26 +0100 Subject: [PATCH 30/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20no-underscore?= =?UTF-8?q?-dangle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 4 ++-- packages/core/src/browser/xhrProxy.ts | 3 ++- packages/core/src/tools/utils.ts | 2 +- packages/logs/src/boot/logs.entry.spec.ts | 1 + packages/rum-core/src/browser/domMutationCollection.ts | 1 + packages/rum-core/src/domain/assembly.spec.ts | 2 +- packages/rum-core/src/domain/assembly.ts | 1 + .../resource/resourceCollection.spec.ts | 4 ++-- packages/rum-recorder/src/domain/rrweb/mutation.ts | 9 +++++++-- packages/rum-recorder/src/domain/rrweb/utils.ts | 7 ++++--- test/e2e/scenario/rum/tracing.scenario.ts | 4 ++-- 11 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 22f672c875..e704e99dc3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -61,10 +61,10 @@ module.exports = { }, }, ], - 'no-underscore-dangle': 'off', + + 'no-underscore-dangle': 'error', 'prefer-rest-params': 'off', 'jsdoc/newline-after-description': 'off', - 'unicorn/filename-case': ['error', { case: 'camelCase' }], 'jsdoc/check-indentation': 'error', 'arrow-body-style': 'error', diff --git a/packages/core/src/browser/xhrProxy.ts b/packages/core/src/browser/xhrProxy.ts index e3d7f2195b..0831ed29fd 100644 --- a/packages/core/src/browser/xhrProxy.ts +++ b/packages/core/src/browser/xhrProxy.ts @@ -67,7 +67,7 @@ export function resetXhrProxy() { function proxyXhr() { originalXhrOpen = XMLHttpRequest.prototype.open originalXhrSend = XMLHttpRequest.prototype.send - + /* eslint-disable no-underscore-dangle */ XMLHttpRequest.prototype.open = monitor(function (this: BrowserXHR, method: string, url: string) { // WARN: since this data structure is tied to the instance, it is shared by both logs and rum // and can be used by different code versions depending on customer setup @@ -117,4 +117,5 @@ function proxyXhr() { return originalXhrSend.apply(this, arguments as any) }) + /* eslint-enable no-underscore-dangle */ } diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 8c77072895..b0ff208c12 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -275,7 +275,7 @@ export function getGlobalObject(): T { // @ts-ignore _dd_temp is defined using defineProperty let globalObject: unknown = _dd_temp_ // @ts-ignore _dd_temp is defined using defineProperty - delete Object.prototype._dd_temp_ + delete Object.prototype._dd_temp_ // eslint-disable-line no-underscore-dangle if (typeof globalObject !== 'object') { // on safari _dd_temp_ is available on window but not globally // fallback on other browser globals check diff --git a/packages/logs/src/boot/logs.entry.spec.ts b/packages/logs/src/boot/logs.entry.spec.ts index 89b9523db5..9712ac474f 100644 --- a/packages/logs/src/boot/logs.entry.spec.ts +++ b/packages/logs/src/boot/logs.entry.spec.ts @@ -62,6 +62,7 @@ describe('logs entry', () => { }) it('should add a `_setDebug` that works', () => { + // eslint-disable-next-line no-underscore-dangle const setDebug: (debug: boolean) => void = (LOGS as any)._setDebug expect(!!setDebug).toEqual(true) diff --git a/packages/rum-core/src/browser/domMutationCollection.ts b/packages/rum-core/src/browser/domMutationCollection.ts index 6d6f20f0fe..0cf7548404 100644 --- a/packages/rum-core/src/browser/domMutationCollection.ts +++ b/packages/rum-core/src/browser/domMutationCollection.ts @@ -26,6 +26,7 @@ function getMutationObserverConstructor(): MutationObserverConstructor | undefin // [1] https://github.com/angular/angular/issues/26948 // [2] https://github.com/angular/angular/issues/31712 if (browserWindow.Zone) { + // eslint-disable-next-line no-underscore-dangle const symbol = browserWindow.Zone.__symbol__('MutationObserver') constructor = browserWindow[symbol as any] as any } diff --git a/packages/rum-core/src/domain/assembly.spec.ts b/packages/rum-core/src/domain/assembly.spec.ts index b9f35f5c23..ee66dea2df 100644 --- a/packages/rum-core/src/domain/assembly.spec.ts +++ b/packages/rum-core/src/domain/assembly.spec.ts @@ -118,7 +118,7 @@ describe('rum assembly', () => { rawRumEvent: createRawRumEvent(RumEventType.VIEW, undefined), startTime: 0, }) - + // eslint-disable-next-line no-underscore-dangle expect(serverRumEvents[0]._dd.format_version).toBe(2) }) diff --git a/packages/rum-core/src/domain/assembly.ts b/packages/rum-core/src/domain/assembly.ts index 82412d051f..ce69f0e9df 100644 --- a/packages/rum-core/src/domain/assembly.ts +++ b/packages/rum-core/src/domain/assembly.ts @@ -101,5 +101,6 @@ function needToAssembleWithAction( } function getSessionType() { + // eslint-disable-next-line no-underscore-dangle return (window as BrowserWindow)._DATADOG_SYNTHETICS_BROWSER === undefined ? SessionType.USER : SessionType.SYNTHETICS } diff --git a/packages/rum-core/src/domain/rumEventsCollection/resource/resourceCollection.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/resource/resourceCollection.spec.ts index c3b616798e..a35bbfb539 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/resource/resourceCollection.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/resource/resourceCollection.spec.ts @@ -194,7 +194,7 @@ describe('resourceCollection', () => { traceId: '1234', }) ) - + // eslint-disable-next-line no-underscore-dangle const traceInfo = (rawRumEvents[0].rawRumEvent as RawRumResourceEvent)._dd! expect(traceInfo).toBeDefined() expect(traceInfo.traceId).toBe('1234') @@ -209,7 +209,7 @@ describe('resourceCollection', () => { traceId: new TraceIdentifier(), }) ) - + // eslint-disable-next-line no-underscore-dangle const traceInfo = (rawRumEvents[0].rawRumEvent as RawRumResourceEvent)._dd! expect(traceInfo).toBeDefined() expect(traceInfo.traceId).toBeDefined() diff --git a/packages/rum-recorder/src/domain/rrweb/mutation.ts b/packages/rum-recorder/src/domain/rrweb/mutation.ts index 149038ae1f..3788bce240 100644 --- a/packages/rum-recorder/src/domain/rrweb/mutation.ts +++ b/packages/rum-recorder/src/domain/rrweb/mutation.ts @@ -51,6 +51,7 @@ class DoubleLinkedList { previous: null, value: n as NodeInLinkedList, } + /* eslint-disable no-underscore-dangle */ ;(n as NodeInLinkedList).__ln = node if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) { const current = n.previousSibling.__ln.next @@ -65,6 +66,7 @@ class DoubleLinkedList { node.previous = current node.next = n.nextSibling.__ln n.nextSibling.__ln.previous = node + /* eslint-enable no-underscore-dangle */ if (current) { current.next = node } @@ -79,7 +81,7 @@ class DoubleLinkedList { } public removeNode(n: NodeInLinkedList) { - const current = n.__ln + const current = n.__ln // eslint-disable-line no-underscore-dangle if (!this.head) { return } @@ -95,9 +97,11 @@ class DoubleLinkedList { current.next.previous = current.previous } } + /* eslint-disable no-underscore-dangle */ if (n.__ln) { delete n.__ln } + /* eslint-enable no-underscore-dangle */ this.length -= 1 } } @@ -422,9 +426,10 @@ export class MutationBuffer { this.movedSet.add(n) let targetId: number | null = null if (target && isINode(target)) { - targetId = target.__sn.id + targetId = target.__sn.id // eslint-disable-line no-underscore-dangle } if (targetId) { + // eslint-disable-next-line no-underscore-dangle this.movedMap[moveKey(n.__sn.id, targetId)] = true } } else { diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index 1f1811f030..205fbe2cc8 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -12,17 +12,18 @@ export const mirror: Mirror = { map: {}, getId(n) { // if n is not a serialized INode, use -1 as its id. + // eslint-disable-next-line no-underscore-dangle if (!n.__sn) { return -1 } - return n.__sn.id + return n.__sn.id // eslint-disable-line no-underscore-dangle }, getNode(id) { return mirror.map[id] || null }, // TODO: use a weakmap to get rid of manually memory management removeNodeFromMap(n) { - const id = n.__sn && n.__sn.id + const id = n.__sn && n.__sn.id // eslint-disable-line no-underscore-dangle delete mirror.map[id] if (n.childNodes) { n.childNodes.forEach((child) => mirror.removeNodeFromMap((child as Node) as INode)) @@ -164,7 +165,7 @@ export function isBlocked(node: Node | null, blockClass: BlockClass): boolean { export function isIgnored(n: Node | INode): boolean { if ('__sn' in n) { - return n.__sn.id === IGNORED_NODE + return n.__sn.id === IGNORED_NODE // eslint-disable-line no-underscore-dangle } // The main part of the slimDOM check happens in // rrweb-snapshot::serializeNodeWithId diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index e27c59345e..03cc333f89 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -39,8 +39,8 @@ describe('tracing', () => { (event) => event.resource.type === 'xhr' || event.resource.type === 'fetch' ) expect(requests.length).toBe(1) - expect(requests[0]._dd.trace_id).toMatch(/\d+/) - expect(requests[0]._dd.span_id).toMatch(/\d+/) + expect(requests[0]._dd.trace_id).toMatch(/\d+/) // eslint-disable-line no-underscore-dangle + expect(requests[0]._dd.span_id).toMatch(/\d+/) // eslint-disable-line no-underscore-dangle expect(requests[0].resource.id).toBeDefined() } }) From e32b49016a751827e7d61743263e53f535f5a22a Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Wed, 20 Jan 2021 15:18:44 +0100 Subject: [PATCH 31/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/require-await?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/tools/specHelper.ts | 6 +++--- scripts/generate-changelog.js | 4 ++-- test/e2e/scenario/rum/tracing.scenario.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e704e99dc3..5ac8257b42 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,6 @@ module.exports = { ], rules: { // Temporary disabled rules - '@typescript-eslint/require-await': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/no-unsafe-return': 'error', @@ -62,6 +61,7 @@ module.exports = { }, ], + '@typescript-eslint/require-await': 'error', 'no-underscore-dangle': 'error', 'prefer-rest-params': 'off', 'jsdoc/newline-after-description': 'off', diff --git a/packages/core/src/tools/specHelper.ts b/packages/core/src/tools/specHelper.ts index 7bdcfc9777..0cbc958b0c 100644 --- a/packages/core/src/tools/specHelper.ts +++ b/packages/core/src/tools/specHelper.ts @@ -66,11 +66,11 @@ export function stubFetch(): FetchStubManager { ...response, clone: () => { const cloned = { - text: async () => { + text: () => { if (response.responseTextError) { - throw response.responseTextError + return Promise.reject(response.responseTextError) } - return response.responseText + return Promise.resolve(response.responseText) }, } return cloned as Response diff --git a/scripts/generate-changelog.js b/scripts/generate-changelog.js index 1afcbbeb37..4715487748 100644 --- a/scripts/generate-changelog.js +++ b/scripts/generate-changelog.js @@ -69,7 +69,7 @@ async function getChangesList() { const commits = await executeCommand(`git log ${lastTagName.trimEnd()}..HEAD --pretty=format:"- %s"`) - const changesWithEmojis = await emojiNameToUnicode(commits) + const changesWithEmojis = emojiNameToUnicode(commits) const changesWithPullRequestLinks = changesWithEmojis.replace( /\(#(\d+)\)/gm, @@ -96,7 +96,7 @@ function spawnCommand(command, args) { }) } -async function emojiNameToUnicode(changes) { +function emojiNameToUnicode(changes) { const emojiNameRegex = new RegExp(/:[^:\s]*(?:::[^:\s]*)*:/, 'gm') return changes.replace(emojiNameRegex, (emoji) => emojiNameMap.get(emoji) || emoji) } diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index 03cc333f89..3b61cd32af 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -12,7 +12,7 @@ describe('tracing', () => { ]) checkRequestHeaders(rawHeaders) await flushEvents() - await checkTraceAssociatedToRumEvent(events) + checkTraceAssociatedToRumEvent(events) }) createTest('trace fetch') @@ -24,7 +24,7 @@ describe('tracing', () => { ]) checkRequestHeaders(rawHeaders) await flushEvents() - await checkTraceAssociatedToRumEvent(events) + checkTraceAssociatedToRumEvent(events) }) function checkRequestHeaders(rawHeaders: string) { @@ -34,7 +34,7 @@ describe('tracing', () => { expect(headers['x-foo']).toBe('bar, baz') } - async function checkTraceAssociatedToRumEvent(events: EventRegistry) { + function checkTraceAssociatedToRumEvent(events: EventRegistry) { const requests = events.rumResources.filter( (event) => event.resource.type === 'xhr' || event.resource.type === 'fetch' ) From bf00750bebb9d035598f02c0631ab7ad01057e9d Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Wed, 20 Jan 2021 18:57:08 +0100 Subject: [PATCH 32/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-empty-interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/tools/context.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5ac8257b42..c5cbd422a4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,7 +26,7 @@ module.exports = { '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/naming-convention': 'off', - '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/prefer-regexp-exec': 'off', '@typescript-eslint/no-inferrable-types': 'off', '@typescript-eslint/no-floating-promises': 'off', diff --git a/packages/core/src/tools/context.ts b/packages/core/src/tools/context.ts index 36b2c58170..1e352ba667 100644 --- a/packages/core/src/tools/context.ts +++ b/packages/core/src/tools/context.ts @@ -4,6 +4,7 @@ export interface Context { export type ContextValue = string | number | boolean | Context | ContextArray | undefined | null +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ContextArray extends Array {} export function withSnakeCaseKeys(candidate: Context): Context { From 2daaf1fea3884c7764c6cf15b7f5fa15a589bf23 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Wed, 20 Jan 2021 19:13:34 +0100 Subject: [PATCH 33/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/prefer-regexp-exec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/domain/tracekit.ts | 2 +- packages/core/src/tools/specHelper.ts | 3 ++- packages/core/src/tools/utils.ts | 3 ++- .../rumEventsCollection/resource/resourceUtils.ts | 10 +++++----- .../rum-core/src/domain/tracing/getDocumentTraceId.ts | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c5cbd422a4..7ca9e06bb5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,7 +27,7 @@ module.exports = { '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-empty-interface': 'error', - '@typescript-eslint/prefer-regexp-exec': 'off', + '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/no-inferrable-types': 'off', '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/restrict-plus-operands': 'off', diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 7b712626a7..f44bbdb4ff 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -238,7 +238,7 @@ export const report = (function reportModuleWrapper() { let name let msg = message if ({}.toString.call(message) === '[object String]') { - const groups = (msg as string).match(ERROR_TYPES_RE) + const groups = ERROR_TYPES_RE.exec(msg as string) if (groups) { name = groups[1] msg = groups[2] diff --git a/packages/core/src/tools/specHelper.ts b/packages/core/src/tools/specHelper.ts index 0cbc958b0c..381e2a5dfa 100644 --- a/packages/core/src/tools/specHelper.ts +++ b/packages/core/src/tools/specHelper.ts @@ -27,7 +27,8 @@ export function isFirefox() { } export function isIE() { - return navigator.userAgent.indexOf('MSIE ') > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) + const hasIEAgent = /Trident.*rv\:11\./.exec(navigator.userAgent) + return navigator.userAgent.indexOf('MSIE ') > 0 || !!hasIEAgent } export function clearAllCookies() { diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index b0ff208c12..a0e5027bad 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -307,7 +307,8 @@ export function getLinkElementOrigin(element: Location | HTMLAnchorElement | URL } export function findCommaSeparatedValue(rawString: string, name: string) { - const matches = rawString.match(`(?:^|;)\\s*${name}\\s*=\\s*([^;]+)`) + const regex = new RegExp(`(?:^|;)\\s*${name}\\s*=\\s*([^;]+)`) + const matches = regex.exec(rawString) return matches ? matches[1] : undefined } diff --git a/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts b/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts index c4115f4e62..ed3f743594 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts @@ -31,18 +31,18 @@ const RESOURCE_TYPES: Array<[ResourceType, (initiatorType: string, path: string) [ResourceType.XHR, (initiatorType: string) => 'xmlhttprequest' === initiatorType], [ResourceType.FETCH, (initiatorType: string) => 'fetch' === initiatorType], [ResourceType.BEACON, (initiatorType: string) => 'beacon' === initiatorType], - [ResourceType.CSS, (_: string, path: string) => path.match(/\.css$/i) !== null], - [ResourceType.JS, (_: string, path: string) => path.match(/\.js$/i) !== null], + [ResourceType.CSS, (_: string, path: string) => /\.css$/i.exec(path) !== null], + [ResourceType.JS, (_: string, path: string) => /\.js$/i.exec(path) !== null], [ ResourceType.IMAGE, (initiatorType: string, path: string) => - includes(['image', 'img', 'icon'], initiatorType) || path.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i) !== null, + includes(['image', 'img', 'icon'], initiatorType) || /\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(path) !== null, ], - [ResourceType.FONT, (_: string, path: string) => path.match(/\.(woff|eot|woff2|ttf)$/i) !== null], + [ResourceType.FONT, (_: string, path: string) => /\.(woff|eot|woff2|ttf)$/i.exec(path) !== null], [ ResourceType.MEDIA, (initiatorType: string, path: string) => - includes(['audio', 'video'], initiatorType) || path.match(/\.(mp3|mp4)$/i) !== null, + includes(['audio', 'video'], initiatorType) || /\.(mp3|mp4)$/i.exec(path) !== null, ], ] diff --git a/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts b/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts index ae31188a80..adb70a347b 100644 --- a/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts +++ b/packages/rum-core/src/domain/tracing/getDocumentTraceId.ts @@ -81,7 +81,7 @@ export function findTraceComment(document: Document): string | undefined { function getTraceCommentFromNode(node: Node | null) { if (node && isCommentNode(node)) { - const match = node.data.match(/^\s*DATADOG;(.*?)\s*$/) + const match = /^\s*DATADOG;(.*?)\s*$/.exec(node.data) if (match) { return match[1] } From 9087a925a5f84cc02d7b7bb65007f0730facaa76 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Wed, 20 Jan 2021 19:16:32 +0100 Subject: [PATCH 34/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-inferrable-types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- .../src/domain/rumEventsCollection/view/trackTimings.ts | 2 +- packages/rum-recorder/src/domain/rrweb/mutation.ts | 2 +- test/e2e/lib/framework/createTest.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7ca9e06bb5..44e51ac388 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,7 +28,7 @@ module.exports = { '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/prefer-regexp-exec': 'error', - '@typescript-eslint/no-inferrable-types': 'off', + '@typescript-eslint/no-inferrable-types': 'error', '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts index 6f3081f00c..c1b6351878 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts @@ -91,7 +91,7 @@ export function trackLargestContentfulPaint( // Ignore entries that come after the first user interaction. According to the documentation, the // browser should not send largest-contentful-paint entries after a user interact with the page, // but the web-vitals reference implementation uses this as a safeguard. - let firstInteractionTimestamp: number = Infinity + let firstInteractionTimestamp = Infinity const { stop: stopEventListener } = addEventListeners( emitter, [DOM_EVENT.POINTER_DOWN, DOM_EVENT.KEY_DOWN], diff --git a/packages/rum-recorder/src/domain/rrweb/mutation.ts b/packages/rum-recorder/src/domain/rrweb/mutation.ts index 3788bce240..f057e4afe6 100644 --- a/packages/rum-recorder/src/domain/rrweb/mutation.ts +++ b/packages/rum-recorder/src/domain/rrweb/mutation.ts @@ -115,7 +115,7 @@ function isINode(n: Node | INode): n is INode { * controls behaviour of a MutationObserver */ export class MutationBuffer { - private frozen: boolean = false + private frozen = false private texts: TextCursor[] = [] private attributes: AttributeCursor[] = [] diff --git a/test/e2e/lib/framework/createTest.ts b/test/e2e/lib/framework/createTest.ts index 8a0296dee0..008cdf5a1f 100644 --- a/test/e2e/lib/framework/createTest.ts +++ b/test/e2e/lib/framework/createTest.ts @@ -35,8 +35,8 @@ type TestRunner = (testContext: TestContext) => Promise class TestBuilder { private rumOptions: RumSetupOptions | undefined = undefined private logsOptions: LogsSetupOptions | undefined = undefined - private head: string = '' - private body: string = '' + private head = '' + private body = '' private setups: Array<{ factory: SetupFactory; name?: string }> = [] constructor(private title: string) {} From e7c9dd253aa92524eedb89c591f665b2113ff2c5 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 10:55:25 +0100 Subject: [PATCH 35/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/no-floating-promises?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/browser/fetchProxy.spec.ts | 34 +++++++++---------- .../domain/automaticErrorCollection.spec.ts | 17 ++++++---- .../src/domain/requestCollection.spec.ts | 10 +++--- packages/rum-core/test/formatValidation.ts | 2 +- test/e2e/lib/framework/httpServers.ts | 2 +- test/e2e/lib/helpers/browser.ts | 2 +- test/e2e/lib/helpers/validation.ts | 2 +- test/e2e/scenario/logs.scenario.ts | 6 ++-- 9 files changed, 40 insertions(+), 37 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 44e51ac388..bd02073195 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,7 +29,7 @@ module.exports = { '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/no-inferrable-types': 'error', - '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/ban-types': [ diff --git a/packages/core/src/browser/fetchProxy.spec.ts b/packages/core/src/browser/fetchProxy.spec.ts index d600509154..bb3015c235 100644 --- a/packages/core/src/browser/fetchProxy.spec.ts +++ b/packages/core/src/browser/fetchProxy.spec.ts @@ -29,7 +29,7 @@ describe('fetch proxy', () => { }) it('should track server error', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -42,7 +42,7 @@ describe('fetch proxy', () => { }) it('should track refused fetch', (done) => { - fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) + void fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -56,7 +56,7 @@ describe('fetch proxy', () => { // https://fetch.spec.whatwg.org/#concept-body-consume-body it('should track fetch with response text error', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 200, responseTextError: new Error('locked') }) + void fetchStub(FAKE_URL).resolveWith({ status: 200, responseTextError: new Error('locked') }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -70,7 +70,7 @@ describe('fetch proxy', () => { it('should track opaque fetch', (done) => { // https://fetch.spec.whatwg.org/#concept-filtered-response-opaque - fetchStub(FAKE_URL).resolveWith({ status: 0, type: 'opaque' }) + void fetchStub(FAKE_URL).resolveWith({ status: 0, type: 'opaque' }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -82,7 +82,7 @@ describe('fetch proxy', () => { }) it('should track client error', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 400, responseText: 'Not found' }) + void fetchStub(FAKE_URL).resolveWith({ status: 400, responseText: 'Not found' }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -95,12 +95,12 @@ describe('fetch proxy', () => { }) it('should get method from input', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 500 }) - fetchStub(new Request(FAKE_URL)).resolveWith({ status: 500 }) - fetchStub(new Request(FAKE_URL, { method: 'PUT' })).resolveWith({ status: 500 }) - fetchStub(new Request(FAKE_URL, { method: 'PUT' }), { method: 'POST' }).resolveWith({ status: 500 }) - fetchStub(new Request(FAKE_URL), { method: 'POST' }).resolveWith({ status: 500 }) - fetchStub(FAKE_URL, { method: 'POST' }).resolveWith({ status: 500 }) + void fetchStub(FAKE_URL).resolveWith({ status: 500 }) + void fetchStub(new Request(FAKE_URL)).resolveWith({ status: 500 }) + void fetchStub(new Request(FAKE_URL, { method: 'PUT' })).resolveWith({ status: 500 }) + void fetchStub(new Request(FAKE_URL, { method: 'PUT' }), { method: 'POST' }).resolveWith({ status: 500 }) + void fetchStub(new Request(FAKE_URL), { method: 'POST' }).resolveWith({ status: 500 }) + void fetchStub(FAKE_URL, { method: 'POST' }).resolveWith({ status: 500 }) fetchStubManager.whenAllComplete(() => { expect(getRequest(0).method).toEqual('GET') @@ -114,8 +114,8 @@ describe('fetch proxy', () => { }) it('should get url from input', (done) => { - fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) - fetchStub(new Request(FAKE_URL)).rejectWith(new Error('fetch error')) + void fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) + void fetchStub(new Request(FAKE_URL)).rejectWith(new Error('fetch error')) fetchStubManager.whenAllComplete(() => { expect(getRequest(0).url).toEqual(FAKE_URL) @@ -127,8 +127,8 @@ describe('fetch proxy', () => { it('should keep promise resolved behavior', (done) => { const fetchStubPromise = fetchStub(FAKE_URL) const spy = jasmine.createSpy() - fetchStubPromise.then(spy) - fetchStubPromise.resolveWith({ status: 500 }) + void fetchStubPromise.then(spy) + void fetchStubPromise.resolveWith({ status: 500 }) setTimeout(() => { expect(spy).toHaveBeenCalled() @@ -140,7 +140,7 @@ describe('fetch proxy', () => { const fetchStubPromise = fetchStub(FAKE_URL) const spy = jasmine.createSpy() fetchStubPromise.catch(spy) - fetchStubPromise.rejectWith(new Error('fetch error')) + void fetchStubPromise.rejectWith(new Error('fetch error')) setTimeout(() => { expect(spy).toHaveBeenCalled() @@ -152,7 +152,7 @@ describe('fetch proxy', () => { fetchProxy.beforeSend((context) => { context.foo = 'bar' }) - fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { expect(getRequest(0).foo).toBe('bar') diff --git a/packages/core/src/domain/automaticErrorCollection.spec.ts b/packages/core/src/domain/automaticErrorCollection.spec.ts index ef113e9491..653e2fca79 100644 --- a/packages/core/src/domain/automaticErrorCollection.spec.ts +++ b/packages/core/src/domain/automaticErrorCollection.spec.ts @@ -153,7 +153,7 @@ describe('network error tracker', () => { }) it('should track server error', (done) => { - fetchStub(FAKE_URL).resolveWith(DEFAULT_REQUEST) + void fetchStub(FAKE_URL).resolveWith(DEFAULT_REQUEST) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).toHaveBeenCalledWith({ @@ -172,7 +172,7 @@ describe('network error tracker', () => { }) it('should not track intake error', (done) => { - fetchStub('https://logs-intake.com/v1/input/send?foo=bar').resolveWith(DEFAULT_REQUEST) + void fetchStub('https://logs-intake.com/v1/input/send?foo=bar').resolveWith(DEFAULT_REQUEST) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).not.toHaveBeenCalled() @@ -181,7 +181,7 @@ describe('network error tracker', () => { }) it('should track refused request', (done) => { - fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 0 }) + void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 0 }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).toHaveBeenCalled() @@ -190,7 +190,7 @@ describe('network error tracker', () => { }) it('should not track client error', (done) => { - fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 400 }) + void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 400 }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).not.toHaveBeenCalled() @@ -199,7 +199,7 @@ describe('network error tracker', () => { }) it('should not track successful request', (done) => { - fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 200 }) + void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 200 }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).not.toHaveBeenCalled() @@ -208,7 +208,7 @@ describe('network error tracker', () => { }) it('should add a default error response', (done) => { - fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, responseText: undefined }) + void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, responseText: undefined }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).toHaveBeenCalled() @@ -219,7 +219,10 @@ describe('network error tracker', () => { }) it('should truncate error response', (done) => { - fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, responseText: 'Lorem ipsum dolor sit amet orci aliquam.' }) + void fetchStub(FAKE_URL).resolveWith({ + ...DEFAULT_REQUEST, + responseText: 'Lorem ipsum dolor sit amet orci aliquam.', + }) fetchStubManager.whenAllComplete(() => { const stack = (errorObservableSpy.calls.mostRecent().args[0] as RawError).stack diff --git a/packages/rum-core/src/domain/requestCollection.spec.ts b/packages/rum-core/src/domain/requestCollection.spec.ts index 5274138ec3..12f6cee2fc 100644 --- a/packages/rum-core/src/domain/requestCollection.spec.ts +++ b/packages/rum-core/src/domain/requestCollection.spec.ts @@ -59,7 +59,7 @@ describe('collect fetch', () => { }) it('should notify on request start', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { expect(startSpy).toHaveBeenCalledWith({ requestIndex: (jasmine.any(Number) as unknown) as number }) @@ -68,7 +68,7 @@ describe('collect fetch', () => { }) it('should notify on request complete', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { const request = completeSpy.calls.argsFor(0)[0] @@ -83,7 +83,7 @@ describe('collect fetch', () => { }) it('should not trace cancelled requests', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 0, responseText: 'fetch cancelled' }) + void fetchStub(FAKE_URL).resolveWith({ status: 0, responseText: 'fetch cancelled' }) fetchStubManager.whenAllComplete(() => { const request = completeSpy.calls.argsFor(0)[0] @@ -95,7 +95,7 @@ describe('collect fetch', () => { }) it('should assign a request id', (done) => { - fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { const startRequestIndex = startSpy.calls.argsFor(0)[0].requestIndex @@ -107,7 +107,7 @@ describe('collect fetch', () => { }) it('should ignore intake requests', (done) => { - fetchStub(SPEC_ENDPOINTS.rumEndpoint!).resolveWith({ status: 200, responseText: 'foo' }) + void fetchStub(SPEC_ENDPOINTS.rumEndpoint!).resolveWith({ status: 200, responseText: 'foo' }) fetchStubManager.whenAllComplete(() => { expect(startSpy).not.toHaveBeenCalled() diff --git a/packages/rum-core/test/formatValidation.ts b/packages/rum-core/test/formatValidation.ts index 50bb6d7f93..13ab67f3ec 100644 --- a/packages/rum-core/test/formatValidation.ts +++ b/packages/rum-core/test/formatValidation.ts @@ -12,7 +12,7 @@ export function validateFormat(rumEvent: Context) { const instance = new ajv({ allErrors: true, }) - instance + void instance .addSchema(_commonSchemaJson, 'schemas/_common-schema.json') .addSchema(viewSchemaJson, 'schemas/view-schema.json') .addSchema(actionSchemaJson, 'schemas/action-schema.json') diff --git a/test/e2e/lib/framework/httpServers.ts b/test/e2e/lib/framework/httpServers.ts index 8ac0cbd42f..47bc02795a 100644 --- a/test/e2e/lib/framework/httpServers.ts +++ b/test/e2e/lib/framework/httpServers.ts @@ -127,7 +127,7 @@ function createIdleWaiter() { clearTimeout(waitTimeoutId) pendingActivities.add(activity) - activity.then(() => { + void activity.then(() => { pendingActivities.delete(activity) if (pendingActivities.size === 0) { diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index dadc292aeb..4bde823f19 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -77,7 +77,7 @@ export async function sendFetch(url: string, headers: string[][] = []): Promise< return browserExecuteAsync( // eslint-disable-next-line @typescript-eslint/no-shadow (url, headers, done) => { - window + void window .fetch(url, { headers }) .then((response) => response.text()) .then(done) diff --git a/test/e2e/lib/helpers/validation.ts b/test/e2e/lib/helpers/validation.ts index 42c5979acb..322794f6a0 100644 --- a/test/e2e/lib/helpers/validation.ts +++ b/test/e2e/lib/helpers/validation.ts @@ -13,7 +13,7 @@ export function validateFormat(events: RumEvent[]) { const instance = new ajv({ allErrors: true, }) - instance + void instance .addSchema(_commonSchemaJson, 'schemas/_common-schema.json') .addSchema(viewSchemaJson, 'schemas/view-schema.json') .addSchema(actionSchemaJson, 'schemas/action-schema.json') diff --git a/test/e2e/scenario/logs.scenario.ts b/test/e2e/scenario/logs.scenario.ts index 293ff54786..a9808dd276 100644 --- a/test/e2e/scenario/logs.scenario.ts +++ b/test/e2e/scenario/logs.scenario.ts @@ -50,10 +50,10 @@ describe('logs', () => { .run(async ({ events, baseUrl }) => { await browserExecuteAsync((unreachableUrl, done) => { let count = 0 - fetch(`/throw`).then(() => (count += 1)) - fetch(`/unknown`).then(() => (count += 1)) + void fetch(`/throw`).then(() => (count += 1)) + void fetch(`/unknown`).then(() => (count += 1)) fetch(unreachableUrl).catch(() => (count += 1)) - fetch(`/ok`).then(() => (count += 1)) + void fetch(`/ok`).then(() => (count += 1)) const interval = setInterval(() => { if (count === 4) { From 5eea344d529bb3af3019b1463b5621082bd340f4 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 11:06:23 +0100 Subject: [PATCH 36/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/restrict-plus-operands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 ++- packages/core/src/domain/tracekit.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index bd02073195..49410eb9de 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,7 +30,7 @@ module.exports = { '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/no-inferrable-types': 'error', '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/restrict-plus-operands': 'off', + '@typescript-eslint/restrict-plus-operands': 'error', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/ban-types': [ 'off', @@ -135,6 +135,7 @@ module.exports = { '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/no-for-in-array': 'error', + '@typescript-eslint/promise-function-async': 'off', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/no-extra-semi': 'off', diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index f44bbdb4ff..4422874d82 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -553,7 +553,7 @@ export const computeStackTrace = (function computeStackTraceWrapper() { // Also note, Firefox's column number is 0-based and everything else expects 1-based, // so adding 1 // NOTE: this hack doesn't work if top-most frame is eval - stack[0].column = (ex as any).columnNumber + 1 + stack[0].column = ((ex as any).columnNumber as number) + 1 } element = { args: parts[2] ? parts[2].split(',') : [], From 5cb20dcf3901ffd7e4f8a887ed1d0c145c6642f7 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 11:20:42 +0100 Subject: [PATCH 37/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/restrict-template-expressions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 ++- packages/core/src/browser/cookie.ts | 4 ++-- packages/core/src/browser/fetchProxy.ts | 2 +- packages/core/src/domain/configuration.ts | 2 +- packages/core/src/domain/internalMonitoring.ts | 2 +- packages/core/src/domain/sessionManagement.ts | 2 +- packages/core/src/domain/tracekit.spec.ts | 2 +- packages/core/src/domain/tracekit.ts | 4 ++-- packages/core/src/tools/error.ts | 6 +++--- packages/rum-core/src/boot/rumPublicApi.ts | 2 +- packages/rum-core/src/domain/requestCollection.spec.ts | 2 +- packages/rum-core/test/formatValidation.ts | 2 +- test/e2e/lib/framework/createTest.ts | 2 +- test/e2e/lib/framework/httpServers.ts | 4 ++-- test/e2e/lib/framework/serverApps/mock.ts | 2 +- test/e2e/lib/helpers/validation.ts | 2 +- 16 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 49410eb9de..7b906df418 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,7 +31,7 @@ module.exports = { '@typescript-eslint/no-inferrable-types': 'error', '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/restrict-plus-operands': 'error', - '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/restrict-template-expressions': 'error', '@typescript-eslint/ban-types': [ 'off', { @@ -296,6 +296,7 @@ module.exports = { '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', }, }, ], diff --git a/packages/core/src/browser/cookie.ts b/packages/core/src/browser/cookie.ts index 5fb2654375..737a9e90ec 100644 --- a/packages/core/src/browser/cookie.ts +++ b/packages/core/src/browser/cookie.ts @@ -88,9 +88,9 @@ export function getCurrentSite() { const testCookieValue = 'test' const domainLevels = window.location.hostname.split('.') - let candidateDomain = domainLevels.pop() + let candidateDomain = domainLevels.pop()! while (domainLevels.length && !getCookie(testCookieName)) { - candidateDomain = `${domainLevels.pop()}.${candidateDomain}` + candidateDomain = `${domainLevels.pop()!}.${candidateDomain}` setCookie(testCookieName, testCookieValue, ONE_SECOND, { domain: candidateDomain }) } getCurrentSiteCache = candidateDomain diff --git a/packages/core/src/browser/fetchProxy.ts b/packages/core/src/browser/fetchProxy.ts index fae2711ef8..062f6c3d1a 100644 --- a/packages/core/src/browser/fetchProxy.ts +++ b/packages/core/src/browser/fetchProxy.ts @@ -94,7 +94,7 @@ function proxyFetch() { try { text = await response.clone().text() } catch (e) { - text = `Unable to retrieve response: ${e}` + text = `Unable to retrieve response: ${e as string}` } context.response = text context.responseType = response.type diff --git a/packages/core/src/domain/configuration.ts b/packages/core/src/domain/configuration.ts index 5510e0d934..a5770f228c 100644 --- a/packages/core/src/domain/configuration.ts +++ b/packages/core/src/domain/configuration.ts @@ -249,7 +249,7 @@ function getHost(intakeType: IntakeType, endpointType: EndpointType, site: strin return `${endpoint}-http-intake.logs.${site}` } const domainParts = site.split('.') - const extension = domainParts.pop() + const extension = domainParts.pop()! const suffix = `${domainParts.join('-')}.${extension}` return `${endpoint}.browser-intake-${suffix}` } diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index 2d20ff5799..cc6a88baf9 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -164,7 +164,7 @@ function formatError(e: unknown) { error: { stack: 'Not an instance of error', }, - message: `Uncaught ${utils.jsonStringify(e)}`, + message: `Uncaught ${utils.jsonStringify(e)!}`, } } diff --git a/packages/core/src/domain/sessionManagement.ts b/packages/core/src/domain/sessionManagement.ts index 9704ef2a71..a1f8e0c616 100644 --- a/packages/core/src/domain/sessionManagement.ts +++ b/packages/core/src/domain/sessionManagement.ts @@ -125,7 +125,7 @@ export function persistSession(session: SessionState, cookie: CookieCache) { session.expire = String(Date.now() + SESSION_EXPIRATION_DELAY) const cookieString = utils .objectEntries(session) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => `${key}=${value as string}`) .join(SESSION_ENTRY_SEPARATOR) cookie.set(cookieString, SESSION_EXPIRATION_DELAY) } diff --git a/packages/core/src/domain/tracekit.spec.ts b/packages/core/src/domain/tracekit.spec.ts index 3a7bac41af..11b496cbbb 100644 --- a/packages/core/src/domain/tracekit.spec.ts +++ b/packages/core/src/domain/tracekit.spec.ts @@ -256,7 +256,7 @@ Error: foo ;[false, true].forEach((callOnError) => { ;[1, 2].forEach((numReports) => { let title = 'it should receive arguments from report() when' - title += ` callOnError is ${callOnError}` + title += ` callOnError is ${callOnError ? 'true' : 'false'}` title += ` and numReports is ${numReports}` it( title, diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index 4422874d82..66b42f9bd2 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -841,10 +841,10 @@ export const computeStackTrace = (function computeStackTraceWrapper() { item.func = parts ? parts.input.substring(0, parts.input.indexOf('{')) : undefined } - if (funcs[`${curr}`]) { + if (funcs[curr.toString()]) { recursion = true } else { - funcs[`${curr}`] = true + funcs[curr.toString()] = true } stack.push(item) diff --git a/packages/core/src/tools/error.ts b/packages/core/src/tools/error.ts index c86e098ff7..ab135652c0 100644 --- a/packages/core/src/tools/error.ts +++ b/packages/core/src/tools/error.ts @@ -28,7 +28,7 @@ export type ErrorSource = typeof ErrorSource[keyof typeof ErrorSource] export function formatUnknownError(stackTrace: StackTrace | undefined, errorObject: any, nonErrorPrefix: string) { if (!stackTrace || (stackTrace.message === undefined && !(errorObject instanceof Error))) { return { - message: `${nonErrorPrefix} ${jsonStringify(errorObject)}`, + message: `${nonErrorPrefix} ${jsonStringify(errorObject)!}`, stack: 'No stack, consider using an instance of Error', type: stackTrace && stackTrace.name, } @@ -42,13 +42,13 @@ export function formatUnknownError(stackTrace: StackTrace | undefined, errorObje } export function toStackTraceString(stack: StackTrace) { - let result = `${stack.name || 'Error'}: ${stack.message}` + let result = `${stack.name || 'Error'}: ${stack.message!}` stack.stack.forEach((frame) => { const func = frame.func === '?' ? '' : frame.func const args = frame.args && frame.args.length > 0 ? `(${frame.args.join(', ')})` : '' const line = frame.line ? `:${frame.line}` : '' const column = frame.line && frame.column ? `:${frame.column}` : '' - result += `\n at ${func}${args} @ ${frame.url}${line}${column}` + result += `\n at ${func!}${args} @ ${frame.url!}${line}${column}` }) return result } diff --git a/packages/rum-core/src/boot/rumPublicApi.ts b/packages/rum-core/src/boot/rumPublicApi.ts index afa108e984..34b5ea98ad 100644 --- a/packages/rum-core/src/boot/rumPublicApi.ts +++ b/packages/rum-core/src/boot/rumPublicApi.ts @@ -119,7 +119,7 @@ export function makeRumPublicApi(startRumImpl: StartRum) { if (source === ErrorSource.CUSTOM || source === ErrorSource.NETWORK || source === ErrorSource.SOURCE) { checkedSource = source } else { - console.error(`DD_RUM.addError: Invalid source '${source}'`) + console.error(`DD_RUM.addError: Invalid source '${(source as any) as string}'`) checkedSource = ErrorSource.CUSTOM } addErrorStrategy({ diff --git a/packages/rum-core/src/domain/requestCollection.spec.ts b/packages/rum-core/src/domain/requestCollection.spec.ts index 12f6cee2fc..51ce438a35 100644 --- a/packages/rum-core/src/domain/requestCollection.spec.ts +++ b/packages/rum-core/src/domain/requestCollection.spec.ts @@ -48,7 +48,7 @@ describe('collect fetch', () => { fetchStub = window.fetch as FetchStub window.onunhandledrejection = (ev: PromiseRejectionEvent) => { - throw new Error(`unhandled rejected promise \n ${ev.reason}`) + throw new Error(`unhandled rejected promise \n ${ev.reason as string}`) } }) diff --git a/packages/rum-core/test/formatValidation.ts b/packages/rum-core/test/formatValidation.ts index 13ab67f3ec..a4ed47904e 100644 --- a/packages/rum-core/test/formatValidation.ts +++ b/packages/rum-core/test/formatValidation.ts @@ -23,6 +23,6 @@ export function validateFormat(rumEvent: Context) { .validate('rum-events-format.json', rumEvent) if (instance.errors) { - instance.errors.map((error) => fail(`${error.dataPath || 'event'} ${error.message}`)) + instance.errors.map((error) => fail(`${error.dataPath || 'event'} ${error.message!}`)) } } diff --git a/test/e2e/lib/framework/createTest.ts b/test/e2e/lib/framework/createTest.ts index 008cdf5a1f..aa8035db5d 100644 --- a/test/e2e/lib/framework/createTest.ts +++ b/test/e2e/lib/framework/createTest.ts @@ -98,7 +98,7 @@ declare function it(expectation: string, assertion?: jasmine.ImplementationCallb function declareTest(title: string, setup: string, runner: TestRunner) { const spec = it(title, async () => { - log(`Start '${spec.getFullName()}' in ${getBrowserName()}`) + log(`Start '${spec.getFullName()}' in ${getBrowserName()!}`) const servers = await getTestServers() const testContext = createTestContext(servers) diff --git a/test/e2e/lib/framework/httpServers.ts b/test/e2e/lib/framework/httpServers.ts index 47bc02795a..e51e7caf80 100644 --- a/test/e2e/lib/framework/httpServers.ts +++ b/test/e2e/lib/framework/httpServers.ts @@ -54,8 +54,8 @@ async function createServer(): Promise { server.on('request', (req: http.IncomingMessage, res: http.ServerResponse) => { res.on('close', () => { - const requestUrl = `${req.headers.host}${req.url}` - log(`${req.method} ${requestUrl} ${res.statusCode}`) + const requestUrl = `${req.headers.host!}${req.url!}` + log(`${req.method!} ${requestUrl} ${res.statusCode}`) }) }) diff --git a/test/e2e/lib/framework/serverApps/mock.ts b/test/e2e/lib/framework/serverApps/mock.ts index 14ce594481..c60d35fcc1 100644 --- a/test/e2e/lib/framework/serverApps/mock.ts +++ b/test/e2e/lib/framework/serverApps/mock.ts @@ -39,7 +39,7 @@ export function createMockServerApp(endpoints: Endpoints, setup: string) { app.get('/redirect', (req, res) => { const redirectUri = url.parse(req.originalUrl) - res.redirect(`ok${redirectUri.search}`) + res.redirect(`ok${redirectUri.search!}`) }) app.get('/headers', (req, res) => { diff --git a/test/e2e/lib/helpers/validation.ts b/test/e2e/lib/helpers/validation.ts index 322794f6a0..7834a625d3 100644 --- a/test/e2e/lib/helpers/validation.ts +++ b/test/e2e/lib/helpers/validation.ts @@ -24,7 +24,7 @@ export function validateFormat(events: RumEvent[]) { .validate('rum-events-format.json', event) if (instance.errors) { - instance.errors.map((error) => fail(`${error.dataPath || 'event'} ${error.message}`)) + instance.errors.map((error) => fail(`${error.dataPath || 'event'} ${error.message!}`)) } }) } From 6ff288d4212e29070bb4c9fef81c936c09c14d73 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 11:28:39 +0100 Subject: [PATCH 38/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/ban-types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 ++- packages/rum-recorder/src/domain/rrweb/types.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7b906df418..f27cb1765d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,12 +33,13 @@ module.exports = { '@typescript-eslint/restrict-plus-operands': 'error', '@typescript-eslint/restrict-template-expressions': 'error', '@typescript-eslint/ban-types': [ - 'off', + 'error', { types: { Object: { message: 'Avoid using the `Object` type. Did you mean `object`?', }, + object: false, Function: { message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', }, diff --git a/packages/rum-recorder/src/domain/rrweb/types.ts b/packages/rum-recorder/src/domain/rrweb/types.ts index c6e96763bb..5954991379 100644 --- a/packages/rum-recorder/src/domain/rrweb/types.ts +++ b/packages/rum-recorder/src/domain/rrweb/types.ts @@ -13,12 +13,12 @@ export enum EventType { export interface DomContentLoadedEvent { type: EventType.DomContentLoaded - data: {} + data: object } export interface LoadedEvent { type: EventType.Load - data: {} + data: object } export interface FullSnapshotEvent { From 29ab003f3820826203b877f7635026bd49fddb65 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 11:31:04 +0100 Subject: [PATCH 39/69] =?UTF-8?q?=F0=9F=94=A8=20Disable=20rule=20no-param-?= =?UTF-8?q?reassign?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index f27cb1765d..3fbaa2576f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -253,7 +253,7 @@ module.exports = { 'no-multiple-empty-lines': 'off', 'no-new-func': 'error', 'no-new-wrappers': 'error', - 'no-param-reassign': 'error', + 'no-param-reassign': 'off', 'no-return-await': 'error', 'no-sequences': 'error', 'no-sparse-arrays': 'error', From 6a9c3c66848dae47a43bd1ed917fd54a0532e306 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 12:58:05 +0100 Subject: [PATCH 40/69] =?UTF-8?q?=F0=9F=94=A8=20Fix=20rule=20@typescript-e?= =?UTF-8?q?slint/unbound-method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- packages/core/src/browser/xhrProxy.ts | 2 ++ .../core/src/domain/automaticErrorCollection.ts | 2 +- packages/core/src/domain/sessionManagement.ts | 7 +++---- packages/core/src/tools/contextManager.ts | 10 ++++------ packages/core/src/tools/utils.ts | 16 ++++++---------- packages/core/src/transport/transport.spec.ts | 17 +++++++++++++++++ packages/rum-core/src/domain/lifeCycle.ts | 2 +- .../action/actionCollection.ts | 2 +- .../action/trackActions.spec.ts | 2 +- .../error/errorCollection.ts | 4 ++-- .../rumEventsCollection/view/trackTimings.ts | 4 ++-- .../rumEventsCollection/view/trackViews.ts | 10 ++++++---- .../rum-core/src/domain/trackEventCounts.ts | 2 +- .../src/domain/trackPageActivities.spec.ts | 2 +- .../rum-core/src/domain/trackPageActivities.ts | 14 ++++++++------ packages/rum-core/test/specHelper.ts | 2 +- .../rum-recorder/src/domain/rrweb/observer.ts | 2 ++ packages/rum-recorder/src/domain/rrweb/utils.ts | 2 ++ 19 files changed, 62 insertions(+), 42 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3fbaa2576f..3d99ac3b1b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,7 @@ module.exports = { ], rules: { // Temporary disabled rules - '@typescript-eslint/unbound-method': 'off', + '@typescript-eslint/unbound-method': 'error', '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/naming-convention': 'off', diff --git a/packages/core/src/browser/xhrProxy.ts b/packages/core/src/browser/xhrProxy.ts index 0831ed29fd..dacf2b1cce 100644 --- a/packages/core/src/browser/xhrProxy.ts +++ b/packages/core/src/browser/xhrProxy.ts @@ -65,7 +65,9 @@ export function resetXhrProxy() { } function proxyXhr() { + // eslint-disable-next-line @typescript-eslint/unbound-method originalXhrOpen = XMLHttpRequest.prototype.open + // eslint-disable-next-line @typescript-eslint/unbound-method originalXhrSend = XMLHttpRequest.prototype.send /* eslint-disable no-underscore-dangle */ XMLHttpRequest.prototype.open = monitor(function (this: BrowserXHR, method: string, url: string) { diff --git a/packages/core/src/domain/automaticErrorCollection.ts b/packages/core/src/domain/automaticErrorCollection.ts index 18934372da..7964f3fb24 100644 --- a/packages/core/src/domain/automaticErrorCollection.ts +++ b/packages/core/src/domain/automaticErrorCollection.ts @@ -110,7 +110,7 @@ export function trackNetworkError(configuration: Configuration, errorObservable: } return { - stop() { + stop: () => { resetXhrProxy() resetFetchProxy() }, diff --git a/packages/core/src/domain/sessionManagement.ts b/packages/core/src/domain/sessionManagement.ts index a1f8e0c616..8af92a26d7 100644 --- a/packages/core/src/domain/sessionManagement.ts +++ b/packages/core/src/domain/sessionManagement.ts @@ -11,7 +11,7 @@ export const VISIBILITY_CHECK_DELAY = utils.ONE_MINUTE export interface Session { renewObservable: Observable - getId(): string | undefined + getId: () => string | undefined getTrackingType(): T | undefined } @@ -63,9 +63,8 @@ export function startSessionManagement( trackVisibility(expandSession) return { - getId() { - return retrieveActiveSession(sessionCookie).id - }, + getId: () => retrieveActiveSession(sessionCookie).id, + getTrackingType() { return retrieveActiveSession(sessionCookie)[productKey] as TrackingType | undefined }, diff --git a/packages/core/src/tools/contextManager.ts b/packages/core/src/tools/contextManager.ts index 3854b24eca..800a548b5c 100644 --- a/packages/core/src/tools/contextManager.ts +++ b/packages/core/src/tools/contextManager.ts @@ -4,19 +4,17 @@ export function createContextManager() { let context: Context = {} return { - get() { - return context - }, + get: () => context, - add(key: string, value: any) { + add: (key: string, value: any) => { context[key] = value as ContextValue }, - remove(key: string) { + remove: (key: string) => { delete context[key] }, - set(newContext: object) { + set: (newContext: object) => { context = newContext as Context }, } diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index a0e5027bad..5c5ddca310 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -42,11 +42,7 @@ export enum RequestType { } // use lodash API -export function throttle( - fn: () => void, - wait: number, - options?: { leading?: boolean; trailing?: boolean } -): { throttled: () => void; cancel: () => void } { +export function throttle(fn: () => void, wait: number, options?: { leading?: boolean; trailing?: boolean }) { const needLeadingExecution = options && options.leading !== undefined ? options.leading : true const needTrailingExecution = options && options.trailing !== undefined ? options.trailing : true let inWaitPeriod = false @@ -54,26 +50,26 @@ export function throttle( let pendingTimeoutId: number return { - throttled(this: any) { + throttled: () => { if (inWaitPeriod) { hasPendingExecution = true return } if (needLeadingExecution) { - fn.apply(this) + fn() } else { hasPendingExecution = true } inWaitPeriod = true pendingTimeoutId = window.setTimeout(() => { if (needTrailingExecution && hasPendingExecution) { - fn.apply(this) + fn() } inWaitPeriod = false hasPendingExecution = false }, wait) }, - cancel() { + cancel: () => { window.clearTimeout(pendingTimeoutId) inWaitPeriod = false hasPendingExecution = false @@ -380,7 +376,7 @@ export function addEventListeners( events: DOM_EVENT[], listener: (event: Event) => void, { once, capture, passive }: { once?: boolean; capture?: boolean; passive?: boolean } = {} -): { stop(): void } { +) { const wrapedListener = monitor( once ? (event: Event) => { diff --git a/packages/core/src/transport/transport.spec.ts b/packages/core/src/transport/transport.spec.ts index b0fb529d5a..034415e4a8 100644 --- a/packages/core/src/transport/transport.spec.ts +++ b/packages/core/src/transport/transport.spec.ts @@ -31,6 +31,7 @@ describe('request', () => { request.send('{"foo":"bar1"}\n{"foo":"bar2"}', 10) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(navigator.sendBeacon).toHaveBeenCalled() }) @@ -49,6 +50,7 @@ describe('request', () => { request.send('{"foo":"bar1"}\n{"foo":"bar2"}', 10) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(navigator.sendBeacon).toHaveBeenCalled() expect(server.requests.length).toEqual(1) }) @@ -73,6 +75,7 @@ describe('batch', () => { batch.flush() + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"hello"}', jasmine.any(Number)) }) @@ -80,9 +83,11 @@ describe('batch', () => { batch.add({ message: 'hello' }) batch.flush() + // eslint-disable-next-line @typescript-eslint/unbound-method ;(transport.send as jasmine.Spy).calls.reset() batch.flush() + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).not.toHaveBeenCalled() }) @@ -98,6 +103,7 @@ describe('batch', () => { batch.add({ message: '1' }) batch.add({ message: '2' }) batch.add({ message: '3' }) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith( '{"message":"1"}\n{"message":"2"}\n{"message":"3"}', jasmine.any(Number) @@ -106,12 +112,15 @@ describe('batch', () => { it('should flush when new message will overflow bytes limit', () => { batch.add({ message: '50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx' }) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).not.toHaveBeenCalled() batch.add({ message: '60 bytes - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' }) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx"}', 50) batch.flush() + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"60 bytes - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}', 60) }) @@ -120,12 +129,14 @@ describe('batch', () => { batch.add({ message: '30 bytes - xxxxx' }) // batch: 60 sep: 1 batch.add({ message: '39 bytes - xxxxxxxxxxxxxx' }) // batch: 99 sep: 2 + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"30 bytes - xxxxx"}\n{"message":"30 bytes - xxxxx"}', 61) }) it('should call send one time when the size is too high and the batch is empty', () => { const message = '101 bytes - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' batch.add({ message }) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith(`{"message":"${message}"}`, 101) }) @@ -134,6 +145,7 @@ describe('batch', () => { batch.add({ message: '50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx' }) batch.add({ message }) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledTimes(2) }) @@ -143,6 +155,7 @@ describe('batch', () => { batch.add({ message: '50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx' }) clock.tick(100) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalled() clock.restore() @@ -153,6 +166,7 @@ describe('batch', () => { batch = new Batch(transport, MAX_SIZE, BATCH_BYTES_LIMIT, 50, FLUSH_TIMEOUT) batch.add({ message: '50 bytes - xxxxxxxxxxxxx' }) + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).not.toHaveBeenCalled() warnStub.restore() }) @@ -163,6 +177,7 @@ describe('batch', () => { batch.upsert({ message: '3' }, 'b') batch.upsert({ message: '4' }, 'c') + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith( '{"message":"2"}\n{"message":"3"}\n{"message":"4"}', jasmine.any(Number) @@ -172,6 +187,7 @@ describe('batch', () => { batch.upsert({ message: '6' }, 'b') batch.upsert({ message: '7' }, 'a') + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith( '{"message":"5"}\n{"message":"6"}\n{"message":"7"}', jasmine.any(Number) @@ -183,6 +199,7 @@ describe('batch', () => { batch.upsert({ message: '11' }, 'b') batch.flush() + // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"10"}\n{"message":"11"}', jasmine.any(Number)) }) }) diff --git a/packages/rum-core/src/domain/lifeCycle.ts b/packages/rum-core/src/domain/lifeCycle.ts index 6a9109476d..67e9e5ed79 100644 --- a/packages/rum-core/src/domain/lifeCycle.ts +++ b/packages/rum-core/src/domain/lifeCycle.ts @@ -23,7 +23,7 @@ export enum LifeCycleEventType { } export interface Subscription { - unsubscribe(): void + unsubscribe: () => void } export class LifeCycle { diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.ts b/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.ts index 410e82127c..d34b8cde89 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.ts @@ -13,7 +13,7 @@ export function startActionCollection(lifeCycle: LifeCycle, configuration: Confi } return { - addAction(action: CustomAction, savedCommonContext?: CommonContext) { + addAction: (action: CustomAction, savedCommonContext?: CommonContext) => { lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, { savedCommonContext, ...processAction(action), diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts index bfbc89d403..483a22b716 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/action/trackActions.spec.ts @@ -20,7 +20,7 @@ function eventsCollector() { }) return { events, - pushEvent(event: T) { + pushEvent: (event: T) => { events.push(event) }, } diff --git a/packages/rum-core/src/domain/rumEventsCollection/error/errorCollection.ts b/packages/rum-core/src/domain/rumEventsCollection/error/errorCollection.ts index 10a5a7ea6a..a7e10d84c4 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/error/errorCollection.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/error/errorCollection.ts @@ -32,10 +32,10 @@ export function doStartErrorCollection( observable.subscribe((error) => lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processError(error))) return { - addError( + addError: ( { error, startTime, context: customerContext, source }: ProvidedError, savedCommonContext?: CommonContext - ) { + ) => { const rawError = computeRawError(error, startTime, source) lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, { customerContext, diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts index c1b6351878..fa508c93b9 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackTimings.ts @@ -37,7 +37,7 @@ export function trackTimings(lifeCycle: LifeCycle, callback: (timings: Timings) }) return { - stop() { + stop: () => { stopNavigationTracking() stopFCPTracking() stopLCPTracking() @@ -115,7 +115,7 @@ export function trackLargestContentfulPaint( ) return { - stop() { + stop: () => { stopEventListener() unsubcribeLifeCycle() }, diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts index 9498c065d9..24e208e844 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts @@ -88,12 +88,12 @@ export function trackViews(location: Location, lifeCycle: LifeCycle) { ) return { - addTiming(name: string, inInitialView = false) { + addTiming: (name: string, inInitialView = false) => { const view = inInitialView ? initialView : currentView view.addTiming(name) view.triggerUpdate() }, - stop() { + stop: () => { stopTimingsTracking() currentView.end() clearInterval(keepAliveInterval) @@ -223,11 +223,13 @@ function isHashAnAnchor(hash: string) { } function trackHistory(onHistoryChange: () => void) { + // eslint-disable-next-line @typescript-eslint/unbound-method const originalPushState = history.pushState history.pushState = monitor(function (this: History['pushState']) { originalPushState.apply(this, arguments as any) onHistoryChange() }) + // eslint-disable-next-line @typescript-eslint/unbound-method const originalReplaceState = history.replaceState history.replaceState = monitor(function (this: History['replaceState']) { originalReplaceState.apply(this, arguments as any) @@ -252,14 +254,14 @@ function trackLoadingTime(loadType: ViewLoadingType, callback: (loadingTime: num } return { - setLoadEvent(loadEvent: number) { + setLoadEvent: (loadEvent: number) => { if (isWaitingForLoadEvent) { isWaitingForLoadEvent = false loadingTimeCandidates.push(loadEvent) invokeCallbackIfAllCandidatesAreReceived() } }, - setActivityLoadingTime(activityLoadingTime: number | undefined) { + setActivityLoadingTime: (activityLoadingTime: number | undefined) => { if (isWaitingForActivityLoadingTime) { isWaitingForActivityLoadingTime = false if (activityLoadingTime !== undefined) { diff --git a/packages/rum-core/src/domain/trackEventCounts.ts b/packages/rum-core/src/domain/trackEventCounts.ts index fe67c4f682..f977d8d9d0 100644 --- a/packages/rum-core/src/domain/trackEventCounts.ts +++ b/packages/rum-core/src/domain/trackEventCounts.ts @@ -39,7 +39,7 @@ export function trackEventCounts(lifeCycle: LifeCycle, callback: (eventCounts: E }) return { - stop() { + stop: () => { subscription.unsubscribe() }, eventCounts, diff --git a/packages/rum-core/src/domain/trackPageActivities.spec.ts b/packages/rum-core/src/domain/trackPageActivities.spec.ts index f586b532ea..9839e02116 100644 --- a/packages/rum-core/src/domain/trackPageActivities.spec.ts +++ b/packages/rum-core/src/domain/trackPageActivities.spec.ts @@ -47,7 +47,7 @@ function eventsCollector() { }) return { events, - pushEvent(event: T) { + pushEvent: (event: T) => { events.push(event) }, } diff --git a/packages/rum-core/src/domain/trackPageActivities.ts b/packages/rum-core/src/domain/trackPageActivities.ts index a0172c57db..15d8d2b0e9 100644 --- a/packages/rum-core/src/domain/trackPageActivities.ts +++ b/packages/rum-core/src/domain/trackPageActivities.ts @@ -15,7 +15,7 @@ export interface PageActivityEvent { export function waitIdlePageActivity( lifeCycle: LifeCycle, completionCallback: (hadActivity: boolean, endTime: number) => void -): { stop(): void } { +) { const { observable: pageActivitiesObservable, stop: stopPageActivitiesTracking } = trackPageActivities(lifeCycle) const { stop: stopWaitPageActivitiesCompletion } = waitPageActivitiesCompletion( @@ -24,7 +24,7 @@ export function waitIdlePageActivity( completionCallback ) - function stop() { + const stop = () => { stopWaitPageActivitiesCompletion() stopPageActivitiesTracking() } @@ -56,7 +56,9 @@ export function waitIdlePageActivity( // // Note: because MAX_DURATION > VALIDATION_DELAY, we are sure that if the process is still alive // after MAX_DURATION, it has been validated. -export function trackPageActivities(lifeCycle: LifeCycle): { observable: Observable; stop(): void } { +export function trackPageActivities( + lifeCycle: LifeCycle +): { observable: Observable; stop: () => void } { const observable = new Observable() const subscriptions: Subscription[] = [] let firstRequestIndex: undefined | number @@ -102,7 +104,7 @@ export function trackPageActivities(lifeCycle: LifeCycle): { observable: Observa return { observable, - stop() { + stop: () => { subscriptions.forEach((s) => s.unsubscribe()) }, } @@ -112,7 +114,7 @@ export function waitPageActivitiesCompletion( pageActivitiesObservable: Observable, stopPageActivitiesTracking: () => void, completionCallback: (hadActivity: boolean, endTime: number) => void -): { stop(): void } { +): { stop: () => void } { let idleTimeoutId: ReturnType let hasCompleted = false @@ -137,7 +139,7 @@ export function waitPageActivitiesCompletion( } }) - function stop() { + const stop = () => { hasCompleted = true clearTimeout(validationTimeoutId) clearTimeout(idleTimeoutId) diff --git a/packages/rum-core/test/specHelper.ts b/packages/rum-core/test/specHelper.ts index cf24685136..41b06cf5b7 100644 --- a/packages/rum-core/test/specHelper.ts +++ b/packages/rum-core/test/specHelper.ts @@ -27,7 +27,7 @@ export interface TestSetupBuilder { build: () => TestIO } -type BeforeBuildCallback = (buildContext: BuildContext) => void | { stop?(): void } +type BeforeBuildCallback = (buildContext: BuildContext) => void | { stop: () => void } interface BuildContext { lifeCycle: LifeCycle configuration: Readonly diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index 47423287ca..46c9340f49 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -275,6 +275,7 @@ function initInputObserver( } function initStyleSheetObserver(cb: StyleSheetRuleCallback): ListenerHandler { + // eslint-disable-next-line @typescript-eslint/unbound-method const insertRule = CSSStyleSheet.prototype.insertRule CSSStyleSheet.prototype.insertRule = function (rule: string, index?: number) { const id = mirror.getId(this.ownerNode as INode) @@ -287,6 +288,7 @@ function initStyleSheetObserver(cb: StyleSheetRuleCallback): ListenerHandler { return insertRule.call(this, rule, index) } + // eslint-disable-next-line @typescript-eslint/unbound-method const deleteRule = CSSStyleSheet.prototype.deleteRule CSSStyleSheet.prototype.deleteRule = function (index: number) { const id = mirror.getId(this.ownerNode as INode) diff --git a/packages/rum-recorder/src/domain/rrweb/utils.ts b/packages/rum-recorder/src/domain/rrweb/utils.ts index 205fbe2cc8..bde2e8e38b 100644 --- a/packages/rum-recorder/src/domain/rrweb/utils.ts +++ b/packages/rum-recorder/src/domain/rrweb/utils.ts @@ -193,10 +193,12 @@ export function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEven export function polyfill(win = window) { if ('NodeList' in win && !win.NodeList.prototype.forEach) { + // eslint-disable-next-line @typescript-eslint/unbound-method win.NodeList.prototype.forEach = (Array.prototype.forEach as unknown) as NodeList['forEach'] } if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) { + // eslint-disable-next-line @typescript-eslint/unbound-method win.DOMTokenList.prototype.forEach = (Array.prototype.forEach as unknown) as DOMTokenList['forEach'] } } From 845055cc3347c2627aa850bf55f030aa0349e986 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 13:20:31 +0100 Subject: [PATCH 41/69] =?UTF-8?q?=F0=9F=91=8C=20Sort=20ESLint=20rules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 177 +++++++++++++++++---------------------------------- 1 file changed, 60 insertions(+), 117 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3d99ac3b1b..12e6d15b3b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,65 +14,16 @@ module.exports = { sourceType: 'module', }, plugins: [ - 'eslint-plugin-unicorn', 'eslint-plugin-import', 'eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', + 'eslint-plugin-unicorn', '@typescript-eslint', ], rules: { - // Temporary disabled rules - '@typescript-eslint/unbound-method': 'error', - '@typescript-eslint/no-var-requires': 'error', - '@typescript-eslint/no-unsafe-return': 'error', - '@typescript-eslint/naming-convention': 'off', - '@typescript-eslint/no-empty-interface': 'error', - '@typescript-eslint/prefer-regexp-exec': 'error', - '@typescript-eslint/no-inferrable-types': 'error', - '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/restrict-plus-operands': 'error', - '@typescript-eslint/restrict-template-expressions': 'error', - '@typescript-eslint/ban-types': [ - 'error', - { - types: { - Object: { - message: 'Avoid using the `Object` type. Did you mean `object`?', - }, - object: false, - Function: { - message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', - }, - // eslint-disable-next-line id-blacklist - Boolean: { - message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', - }, - // eslint-disable-next-line id-blacklist - Number: { - message: 'Avoid using the `Number` type. Did you mean `number`?', - }, - // eslint-disable-next-line id-blacklist - String: { - message: 'Avoid using the `String` type. Did you mean `string`?', - }, - Symbol: { - message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', - }, - }, - }, - ], - - '@typescript-eslint/require-await': 'error', - 'no-underscore-dangle': 'error', - 'prefer-rest-params': 'off', - 'jsdoc/newline-after-description': 'off', - 'unicorn/filename-case': ['error', { case: 'camelCase' }], - 'jsdoc/check-indentation': 'error', - 'arrow-body-style': 'error', - 'no-redeclare': 'off', - 'no-shadow': 'off', - 'no-throw-literal': 'error', - '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], + '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/ban-ts-comment': [ 'error', { @@ -82,19 +33,41 @@ module.exports = { 'ts-check': 'allow-with-description', }, ], + '@typescript-eslint/ban-types': [ + 'error', + { + types: { + /* eslint-disable id-blacklist */ + Object: { message: 'Avoid using the `Object` type. Did you mean `object`?' }, + object: false, + Function: { message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.' }, + Boolean: { message: 'Avoid using the `Boolean` type. Did you mean `boolean`?' }, + Number: { message: 'Avoid using the `Number` type. Did you mean `number`?' }, + String: { message: 'Avoid using the `String` type. Did you mean `string`?' }, + Symbol: { message: 'Avoid using the `Symbol` type. Did you mean `symbol`?' }, + /* eslint-enable id-blacklist */ + }, + }, + ], + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/explicit-member-accessibility': ['off', { accessibility: 'explicit' }], + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/indent': 'off', + '@typescript-eslint/member-delimiter-style': [ + 'off', + { multiline: { delimiter: 'none', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false } }, + ], '@typescript-eslint/member-ordering': [ 'error', { default: { memberTypes: [ - // Index signature 'signature', - - // Static Fields 'public-static-field', 'protected-static-field', 'private-static-field', - // Instance Fields 'public-decorated-field', 'public-instance-field', 'public-abstract-field', @@ -104,18 +77,12 @@ module.exports = { 'private-decorated-field', 'private-instance-field', 'private-abstract-field', - - // Constructors 'public-constructor', 'protected-constructor', 'private-constructor', - - // Static Methods 'public-static-method', 'protected-static-method', 'private-static-method', - - // Instance Methods 'public-decorated-method', 'public-instance-method', 'public-abstract-method', @@ -130,73 +97,52 @@ module.exports = { }, }, ], - '@typescript-eslint/no-redeclare': 'error', - '@typescript-eslint/no-shadow': 'error', - '@typescript-eslint/await-thenable': 'error', - '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], - '@typescript-eslint/adjacent-overload-signatures': 'error', - '@typescript-eslint/no-for-in-array': 'error', - '@typescript-eslint/promise-function-async': 'off', - '@typescript-eslint/consistent-type-assertions': 'error', - '@typescript-eslint/consistent-type-definitions': 'error', - '@typescript-eslint/no-extra-semi': 'off', - '@typescript-eslint/dot-notation': 'error', - '@typescript-eslint/no-unused-vars': 'error', - '@typescript-eslint/explicit-member-accessibility': [ - 'off', - { - accessibility: 'explicit', - }, - ], - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/member-delimiter-style': [ - 'off', - { - multiline: { - delimiter: 'none', - requireLast: true, - }, - singleline: { - delimiter: 'semi', - requireLast: false, - }, - }, - ], - '@typescript-eslint/indent': 'off', + '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-extra-non-null-assertion': 'error', + '@typescript-eslint/no-extra-semi': 'off', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-inferrable-types': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-misused-promises': 'error', '@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-parameter-properties': 'off', + '@typescript-eslint/no-redeclare': 'error', + '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'error', '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/no-unused-expressions': 'error', + '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/prefer-as-const': 'error', '@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-function-type': 'error', '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/promise-function-async': 'off', '@typescript-eslint/quotes': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', '@typescript-eslint/semi': ['off', null], - '@typescript-eslint/triple-slash-reference': [ - 'error', - { - path: 'always', - types: 'prefer-import', - lib: 'always', - }, - ], + '@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'prefer-import', lib: 'always' }], '@typescript-eslint/type-annotation-spacing': 'off', + '@typescript-eslint/unbound-method': 'error', '@typescript-eslint/unified-signatures': 'error', + 'arrow-body-style': 'error', 'arrow-parens': ['off', 'always'], 'brace-style': ['off', 'off'], 'comma-dangle': 'off', @@ -222,14 +168,11 @@ module.exports = { 'import/no-default-export': 'error', 'import/order': 'error', 'jsdoc/check-alignment': 'error', + 'jsdoc/check-indentation': 'error', + 'jsdoc/newline-after-description': 'off', 'linebreak-style': 'off', 'max-classes-per-file': 'off', - 'max-len': [ - 'error', - { - code: 120, - }, - ], + 'max-len': ['error', { code: 120 }], 'new-parens': 'off', 'newline-per-chained-call': 'off', 'no-array-constructor': 'off', @@ -254,12 +197,16 @@ module.exports = { 'no-new-func': 'error', 'no-new-wrappers': 'error', 'no-param-reassign': 'off', + 'no-redeclare': 'off', 'no-return-await': 'error', 'no-sequences': 'error', + 'no-shadow': 'off', 'no-sparse-arrays': 'error', 'no-template-curly-in-string': 'error', + 'no-throw-literal': 'error', 'no-trailing-spaces': 'off', 'no-undef-init': 'error', + 'no-underscore-dangle': 'error', 'no-unsafe-finally': 'error', 'no-unused-labels': 'error', 'no-unused-vars': 'off', @@ -268,19 +215,15 @@ module.exports = { 'one-var': ['error', 'never'], 'prefer-const': 'error', 'prefer-object-spread': 'error', + 'prefer-rest-params': 'off', 'prefer-template': 'error', 'quote-props': 'off', radix: 'error', 'require-await': 'off', 'space-before-function-paren': 'off', 'space-in-parens': ['off', 'never'], - 'spaced-comment': [ - 'error', - 'always', - { - markers: ['/'], - }, - ], + 'spaced-comment': ['error', 'always', { markers: ['/'] }], + 'unicorn/filename-case': ['error', { case: 'camelCase' }], 'use-isnan': 'error', 'valid-typeof': 'off', }, From c7eeb35c9b13608bd4d662409736ee279b2de620 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 15:05:29 +0100 Subject: [PATCH 42/69] =?UTF-8?q?=F0=9F=8E=A8=20Remove=20rules=20already?= =?UTF-8?q?=20on=20@typescript-eslint/recommended?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 50 ++++---------------------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 12e6d15b3b..cafeb7e7ee 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,9 +21,7 @@ module.exports = { '@typescript-eslint', ], rules: { - '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], - '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/ban-ts-comment': [ 'error', { @@ -49,16 +47,10 @@ module.exports = { }, }, ], - '@typescript-eslint/consistent-type-assertions': 'error', - '@typescript-eslint/consistent-type-definitions': 'error', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-member-accessibility': ['off', { accessibility: 'explicit' }], '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/indent': 'off', - '@typescript-eslint/member-delimiter-style': [ - 'off', - { multiline: { delimiter: 'none', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false } }, - ], + '@typescript-eslint/member-delimiter-style': 'off', '@typescript-eslint/member-ordering': [ 'error', { @@ -98,53 +90,21 @@ module.exports = { }, ], '@typescript-eslint/naming-convention': 'off', - '@typescript-eslint/no-array-constructor': 'error', - '@typescript-eslint/no-empty-function': 'error', - '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-extra-non-null-assertion': 'error', '@typescript-eslint/no-extra-semi': 'off', - '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/no-for-in-array': 'error', - '@typescript-eslint/no-implied-eval': 'error', - '@typescript-eslint/no-inferrable-types': 'error', - '@typescript-eslint/no-misused-new': 'error', - '@typescript-eslint/no-misused-promises': 'error', - '@typescript-eslint/no-namespace': 'error', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-parameter-properties': 'off', - '@typescript-eslint/no-redeclare': 'error', - '@typescript-eslint/no-shadow': 'error', - '@typescript-eslint/no-this-alias': 'error', - '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', - '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-call': 'error', '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-return': 'error', - '@typescript-eslint/no-unused-expressions': 'error', - '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-use-before-define': 'off', - '@typescript-eslint/no-var-requires': 'error', - '@typescript-eslint/prefer-as-const': 'error', - '@typescript-eslint/prefer-for-of': 'error', - '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', - '@typescript-eslint/prefer-regexp-exec': 'error', '@typescript-eslint/promise-function-async': 'off', '@typescript-eslint/quotes': 'off', - '@typescript-eslint/require-await': 'error', - '@typescript-eslint/restrict-plus-operands': 'error', - '@typescript-eslint/restrict-template-expressions': 'error', - '@typescript-eslint/semi': ['off', null], + '@typescript-eslint/semi': 'off', '@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'prefer-import', lib: 'always' }], '@typescript-eslint/type-annotation-spacing': 'off', - '@typescript-eslint/unbound-method': 'error', - '@typescript-eslint/unified-signatures': 'error', 'arrow-body-style': 'error', - 'arrow-parens': ['off', 'always'], - 'brace-style': ['off', 'off'], + 'arrow-parens': 'off', + 'brace-style': 'off', 'comma-dangle': 'off', complexity: 'off', 'constructor-super': 'error', @@ -210,10 +170,8 @@ module.exports = { 'no-unsafe-finally': 'error', 'no-unused-labels': 'error', 'no-unused-vars': 'off', - 'no-var': 'error', 'object-shorthand': 'error', 'one-var': ['error', 'never'], - 'prefer-const': 'error', 'prefer-object-spread': 'error', 'prefer-rest-params': 'off', 'prefer-template': 'error', From 97fcc7c7f34e8de6d3a136ad847fe581fe72bb17 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 16:05:25 +0100 Subject: [PATCH 43/69] Fix ESLint errors --- .eslintrc.js | 1 + .../rum-recorder/src/domain/deflateWorker.js | 133 ++++++++++-------- .../rum-recorder/src/domain/rrweb/observer.ts | 3 +- .../rum-recorder/src/domain/segment.spec.ts | 2 +- .../src/domain/segmentCollection.spec.ts | 4 +- test/e2e/lib/framework/serverApps/intake.ts | 9 +- test/e2e/scenario/rum/tracing.scenario.ts | 5 +- 7 files changed, 87 insertions(+), 70 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cafeb7e7ee..ebc471fa54 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -198,6 +198,7 @@ module.exports = { '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', '@typescript-eslint/restrict-template-expressions': 'off', }, }, diff --git a/packages/rum-recorder/src/domain/deflateWorker.js b/packages/rum-recorder/src/domain/deflateWorker.js index 3532339ced..0dd2e9dc3c 100644 --- a/packages/rum-recorder/src/domain/deflateWorker.js +++ b/packages/rum-recorder/src/domain/deflateWorker.js @@ -1,3 +1,4 @@ +/* eslint-disable no-bitwise,max-len,no-underscore-dangle,jsdoc/check-indentation */ let workerURL export function createDeflateWorker() { @@ -334,7 +335,8 @@ function workerCodeFn() { var h /* heap index */ - var n; var m + var n + var m /* iterate over the tree elements */ var bits @@ -887,7 +889,8 @@ function workerCodeFn() { var stree = desc.stat_desc.static_tree var has_stree = desc.stat_desc.has_stree var elems = desc.stat_desc.elems - var n; var m + var n + var m /* iterate over heap elements */ var max_code = -1 @@ -1390,7 +1393,8 @@ function workerCodeFn() { stored_len, last // DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ ) { - var opt_lenb; var static_lenb + var opt_lenb + var static_lenb /* opt_len and static_len in bytes */ var max_blindex = 0 @@ -1561,9 +1565,9 @@ function workerCodeFn() { // 3. This notice may not be removed or altered from any source distribution. var adler32 = function adler32(adler, buf, len, pos) { - var s1 = (adler & 0xffff) | 0; - var s2 = ((adler >>> 16) & 0xffff) | 0; - var n = 0 + var s1 = (adler & 0xffff) | 0 + var s2 = ((adler >>> 16) & 0xffff) | 0 + var n = 0 while (len !== 0) { // Set limit ~ twice less than 5552, to keep @@ -1609,8 +1613,8 @@ function workerCodeFn() { // Use ordinary array, since untyped makes no boost here var makeTable = function makeTable() { - var c; - var table = [] + var c + var table = [] for (var n = 0; n < 256; n++) { c = n @@ -1768,33 +1772,33 @@ function workerCodeFn() { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var _tr_init$1 = trees._tr_init; - var _tr_stored_block$1 = trees._tr_stored_block; - var _tr_flush_block$1 = trees._tr_flush_block; - var _tr_tally$1 = trees._tr_tally; - var _tr_align$1 = trees._tr_align + var _tr_init$1 = trees._tr_init + var _tr_stored_block$1 = trees._tr_stored_block + var _tr_flush_block$1 = trees._tr_flush_block + var _tr_tally$1 = trees._tr_tally + var _tr_align$1 = trees._tr_align /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_NO_FLUSH = constants.Z_NO_FLUSH; - var Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH; - var Z_FULL_FLUSH = constants.Z_FULL_FLUSH; - var Z_FINISH = constants.Z_FINISH; - var Z_BLOCK = constants.Z_BLOCK; - var Z_OK = constants.Z_OK; - var Z_STREAM_END = constants.Z_STREAM_END; - var Z_STREAM_ERROR = constants.Z_STREAM_ERROR; - var Z_DATA_ERROR = constants.Z_DATA_ERROR; - var Z_BUF_ERROR = constants.Z_BUF_ERROR; - var Z_DEFAULT_COMPRESSION = constants.Z_DEFAULT_COMPRESSION; - var Z_FILTERED = constants.Z_FILTERED; - var Z_HUFFMAN_ONLY = constants.Z_HUFFMAN_ONLY; - var Z_RLE = constants.Z_RLE; - var Z_FIXED$1 = constants.Z_FIXED; - var Z_DEFAULT_STRATEGY = constants.Z_DEFAULT_STRATEGY; - var Z_UNKNOWN$1 = constants.Z_UNKNOWN; - var Z_DEFLATED = constants.Z_DEFLATED + var Z_NO_FLUSH = constants.Z_NO_FLUSH + var Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH + var Z_FULL_FLUSH = constants.Z_FULL_FLUSH + var Z_FINISH = constants.Z_FINISH + var Z_BLOCK = constants.Z_BLOCK + var Z_OK = constants.Z_OK + var Z_STREAM_END = constants.Z_STREAM_END + var Z_STREAM_ERROR = constants.Z_STREAM_ERROR + var Z_DATA_ERROR = constants.Z_DATA_ERROR + var Z_BUF_ERROR = constants.Z_BUF_ERROR + var Z_DEFAULT_COMPRESSION = constants.Z_DEFAULT_COMPRESSION + var Z_FILTERED = constants.Z_FILTERED + var Z_HUFFMAN_ONLY = constants.Z_HUFFMAN_ONLY + var Z_RLE = constants.Z_RLE + var Z_FIXED$1 = constants.Z_FIXED + var Z_DEFAULT_STRATEGY = constants.Z_DEFAULT_STRATEGY + var Z_UNKNOWN$1 = constants.Z_UNKNOWN + var Z_DEFLATED = constants.Z_DEFLATED /* ============================================================================*/ var MAX_MEM_LEVEL = 9 @@ -2105,7 +2109,11 @@ function workerCodeFn() { var fill_window = function fill_window(s) { var _w_size = s.w_size - var p; var n; var m; var more; var str // Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + var p + var n + var m + var more + var str // Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); do { more = s.window_size - s.lookahead - s.strstart // JS ints have 32 bit, block below not needed @@ -2712,7 +2720,8 @@ function workerCodeFn() { var prev /* byte at distance one to match */ - var scan; var strend + var scan + var strend /* scan goes up to strend for length of run */ var _win = s.window @@ -3346,7 +3355,8 @@ function workerCodeFn() { } var deflate = function deflate(strm, flush) { - var beg; var val // for gzip header write only + var beg + var val // for gzip header write only if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR @@ -3912,7 +3922,7 @@ function workerCodeFn() { } if (_typeof(source) !== 'object') { - throw new TypeError(`${source }must be non-object`) + throw new TypeError(`${source}must be non-object`) } for (var p in source) { @@ -3975,13 +3985,13 @@ function workerCodeFn() { // convert string to array (typed, when possible) var string2buf = function string2buf(str) { - var buf; - var c; - var c2; - var m_pos; - var i; - var str_len = str.length; - var buf_len = 0 // count binary size + var buf + var c + var c2 + var m_pos + var i + var str_len = str.length + var buf_len = 0 // count binary size for (m_pos = 0; m_pos < str_len; m_pos++) { c = str.charCodeAt(m_pos) @@ -4056,7 +4066,8 @@ function workerCodeFn() { } // convert array to string var buf2string = function buf2string(buf, max) { - var i; var out + var i + var out var len = max || buf.length // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -4198,20 +4209,21 @@ function workerCodeFn() { var zstream = ZStream + // eslint-disable-next-line @typescript-eslint/unbound-method var toString = Object.prototype.toString /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_NO_FLUSH$1 = constants.Z_NO_FLUSH; - var Z_SYNC_FLUSH = constants.Z_SYNC_FLUSH; - var Z_FULL_FLUSH$1 = constants.Z_FULL_FLUSH; - var Z_FINISH$1 = constants.Z_FINISH; - var Z_OK$1 = constants.Z_OK; - var Z_STREAM_END$1 = constants.Z_STREAM_END; - var Z_DEFAULT_COMPRESSION$1 = constants.Z_DEFAULT_COMPRESSION; - var Z_DEFAULT_STRATEGY$1 = constants.Z_DEFAULT_STRATEGY; - var Z_DEFLATED$1 = constants.Z_DEFLATED + var Z_NO_FLUSH$1 = constants.Z_NO_FLUSH + var Z_SYNC_FLUSH = constants.Z_SYNC_FLUSH + var Z_FULL_FLUSH$1 = constants.Z_FULL_FLUSH + var Z_FINISH$1 = constants.Z_FINISH + var Z_OK$1 = constants.Z_OK + var Z_STREAM_END$1 = constants.Z_STREAM_END + var Z_DEFAULT_COMPRESSION$1 = constants.Z_DEFAULT_COMPRESSION + var Z_DEFAULT_STRATEGY$1 = constants.Z_DEFAULT_STRATEGY + var Z_DEFLATED$1 = constants.Z_DEFLATED /* ===========================================================================*/ /** @@ -4387,14 +4399,18 @@ function workerCodeFn() { var strm = this.strm var chunkSize = this.options.chunkSize - var status; var _flush_mode + var status + var _flush_mode if (this.ended) { return false } - if (flush_mode === ~~flush_mode) {_flush_mode = flush_mode} - else {_flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1} // Convert data if needed + if (flush_mode === ~~flush_mode) { + _flush_mode = flush_mode + } else { + _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1 + } // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. @@ -4445,7 +4461,9 @@ function workerCodeFn() { continue } - if (strm.avail_in === 0) {break} + if (strm.avail_in === 0) { + break + } } return true @@ -4533,6 +4551,7 @@ function workerCodeFn() { * (header and adler32 crc). **/ + // eslint-disable-next-line @typescript-eslint/no-unused-vars function deflateRaw(input, options) { options = options || {} options.raw = true @@ -4546,7 +4565,7 @@ function workerCodeFn() { * The same as [[deflate]], but create gzip wrapper instead of * deflate one. **/ - + // eslint-disable-next-line @typescript-eslint/no-unused-vars function gzip(input, options) { options = options || {} options.gzip = true diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index 5c5f96864f..7bf4196c7c 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -400,7 +400,8 @@ function initFontObserver(cb: FontCallback): ListenerHandler { const restoreHandler = patch( (document as DocumentWithFonts).fonts, 'add', - (original: (fontFace: FontFace) => unknown) => function (this: unknown, fontFace: FontFace) { + (original: (fontFace: FontFace) => unknown) => + function (this: unknown, fontFace: FontFace) { setTimeout(() => { const p = fontMap.get(fontFace) if (p) { diff --git a/packages/rum-recorder/src/domain/segment.spec.ts b/packages/rum-recorder/src/domain/segment.spec.ts index 4bbac342a2..8975cdccb5 100644 --- a/packages/rum-recorder/src/domain/segment.spec.ts +++ b/packages/rum-recorder/src/domain/segment.spec.ts @@ -102,7 +102,7 @@ class StringWriter implements SegmentWriter { this.output += data } flush(data: string, meta: SegmentMeta) { - this.flushed.push({ meta, segment: JSON.parse(this.output + data) }) + this.flushed.push({ meta, segment: JSON.parse(this.output + data) }) this.output = '' } } diff --git a/packages/rum-recorder/src/domain/segmentCollection.spec.ts b/packages/rum-recorder/src/domain/segmentCollection.spec.ts index 042bc6d9de..a5b8cfd8fc 100644 --- a/packages/rum-recorder/src/domain/segmentCollection.spec.ts +++ b/packages/rum-recorder/src/domain/segmentCollection.spec.ts @@ -6,7 +6,6 @@ import { SEND_BEACON_BYTE_LENGTH_LIMIT } from '../transport/send' import { Segment } from './segment' import { computeSegmentContext, doStartSegmentCollection, MAX_SEGMENT_DURATION } from './segmentCollection' - const CONTEXT: SegmentContext = { application: { id: 'a' }, view: { id: 'b' }, session: { id: 'c' } } const RECORD: Record = { type: RecordType.Load, timestamp: 10, data: {} } @@ -30,7 +29,7 @@ describe('startSegmentCollection', () => { lifeCycle, segmentFlushSpy, worker, - sendCurrentSegment() { + sendCurrentSegment: () => { // Make sure the segment is not empty addRecord(RECORD) // Flush segment @@ -194,6 +193,7 @@ describe('computeSegmentContext', () => { }) function mockParentContexts(view: ViewContext | undefined): ParentContexts { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return { findView() { return view diff --git a/test/e2e/lib/framework/serverApps/intake.ts b/test/e2e/lib/framework/serverApps/intake.ts index 35aa0b0bc8..f7b10a5389 100644 --- a/test/e2e/lib/framework/serverApps/intake.ts +++ b/test/e2e/lib/framework/serverApps/intake.ts @@ -49,13 +49,8 @@ async function readSessionReplay(req: express.Request): Promise { - try { - const segment = await segmentPromise - resolve({ meta, segment }) - } catch (e) { - reject(e) - } + req.busboy.on('finish', () => { + segmentPromise.then((segment) => resolve({ meta, segment })).catch((e) => reject(e)) }) }) } diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index a8c3a7e42c..44f6cbec3b 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -19,7 +19,7 @@ describe('tracing', () => { .withRum({ service: 'Service', allowedTracingOrigins: ['LOCATION_ORIGIN'] }) .run(async ({ events }) => { const rawHeaders = await browserExecuteAsync((done) => { - window + void window .fetch('/headers', { headers: [ ['x-foo', 'bar'], @@ -31,6 +31,7 @@ describe('tracing', () => { }) checkRequestHeaders(rawHeaders) await flushEvents() + // eslint-disable-next-line @typescript-eslint/await-thenable await checkTraceAssociatedToRumEvent(events) }) @@ -38,7 +39,7 @@ describe('tracing', () => { .withRum({ service: 'Service', allowedTracingOrigins: ['LOCATION_ORIGIN'] }) .run(async ({ events }) => { const rawHeaders = await browserExecuteAsync((done) => { - window + void window .fetch(new Request('/headers', { headers: { 'x-foo': 'bar, baz' } })) .then((response) => response.text()) .then(done) From ae39b4fea5c75ac0e6df05fbb83d8cd3dab89488 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Thu, 21 Jan 2021 16:08:17 +0100 Subject: [PATCH 44/69] =?UTF-8?q?=F0=9F=94=A8=20Remove=20Useless=20TSLint?= =?UTF-8?q?=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/domain/tracekitParser.spec.ts | 2 -- packages/rum-recorder/src/transport/send.spec.ts | 1 - scripts/generate-schema-types.js | 2 +- test/e2e/lib/framework/eventsRegistry.ts | 1 - test/e2e/lib/helpers/sdk.ts | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/core/src/domain/tracekitParser.spec.ts b/packages/core/src/domain/tracekitParser.spec.ts index edd1260a8a..4d2cb53777 100644 --- a/packages/core/src/domain/tracekitParser.spec.ts +++ b/packages/core/src/domain/tracekitParser.spec.ts @@ -1,5 +1,3 @@ -// eslint-disable - import * as CapturedExceptions from '../../test/capturedExceptions' import { isSafari } from '../tools/specHelper' import { BrowserError, computeStackTrace } from './tracekit' diff --git a/packages/rum-recorder/src/transport/send.spec.ts b/packages/rum-recorder/src/transport/send.spec.ts index d9d42f8041..f605fb1397 100644 --- a/packages/rum-recorder/src/transport/send.spec.ts +++ b/packages/rum-recorder/src/transport/send.spec.ts @@ -24,7 +24,6 @@ describe('toFormEntries', () => { }) it('converts values to string', () => { - // tslint:disable-next-line: no-null-keyword toFormEntries({ foo: 42, bar: null }, callbackSpy) expect(callbackSpy.calls.allArgs()).toEqual([ ['foo', '42'], diff --git a/scripts/generate-schema-types.js b/scripts/generate-schema-types.js index f95b8219d1..3b449e59d6 100644 --- a/scripts/generate-schema-types.js +++ b/scripts/generate-schema-types.js @@ -14,7 +14,7 @@ async function main() { const compiledTypes = await compileFromFile(schemaPath, { cwd: workingDirectory, bannerComment: - '/* tslint:disable */\n/**\n * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead.\n*/', + '/* eslint disable */\n/**\n * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead.\n*/', style: prettierConfig, }) console.log(`writing ${compiledTypesPath}`) diff --git a/test/e2e/lib/framework/eventsRegistry.ts b/test/e2e/lib/framework/eventsRegistry.ts index 64f68b69a8..95cf8004b7 100644 --- a/test/e2e/lib/framework/eventsRegistry.ts +++ b/test/e2e/lib/framework/eventsRegistry.ts @@ -18,7 +18,6 @@ export class EventRegistry { readonly internalMonitoring: ServerInternalMonitoringMessage[] = [] push(type: IntakeType, event: any) { - // tslint:disable-next-line: no-unsafe-any this[type].push(event) } diff --git a/test/e2e/lib/helpers/sdk.ts b/test/e2e/lib/helpers/sdk.ts index f8fc530369..c77e2421cd 100644 --- a/test/e2e/lib/helpers/sdk.ts +++ b/test/e2e/lib/helpers/sdk.ts @@ -30,6 +30,5 @@ export async function expireSession() { async function findSessionCookie() { const cookies = (await browser.getCookies()) || [] - // tslint:disable-next-line: no-unsafe-any return cookies.find((cookie: any) => cookie.name === '_dd_s') } From a957dee40589ae449e9cf781bfbc7eb96df9a425 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 15:01:22 +0100 Subject: [PATCH 45/69] Remove uneeded operators and comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastien Caudan Co-authored-by: Benoît --- packages/core/src/domain/tracekitHandler.spec.ts | 2 +- packages/core/src/tools/context.spec.ts | 2 -- packages/rum-core/src/boot/rumPublicApi.ts | 2 +- packages/rum-core/src/domain/tracing/tracer.spec.ts | 1 - packages/rum-core/src/domain/trackPageActivities.spec.ts | 2 +- packages/rum-recorder/src/domain/rrweb/observer.ts | 1 - test/e2e/lib/helpers/browser.ts | 1 - test/e2e/scenario/rum/tracing.scenario.ts | 3 +-- 8 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/core/src/domain/tracekitHandler.spec.ts b/packages/core/src/domain/tracekitHandler.spec.ts index 69ef4ffcb2..1f1a152af2 100644 --- a/packages/core/src/domain/tracekitHandler.spec.ts +++ b/packages/core/src/domain/tracekitHandler.spec.ts @@ -13,7 +13,7 @@ describe('Handler', () => { } report.subscribe(handler) - expect((): void => wrap(throwException)()).toThrowError() + expect(() => wrap(throwException)()).toThrowError() setTimeout(() => { report.unsubscribe(handler) diff --git a/packages/core/src/tools/context.spec.ts b/packages/core/src/tools/context.spec.ts index cdb6cdbb8c..230772d8ac 100644 --- a/packages/core/src/tools/context.spec.ts +++ b/packages/core/src/tools/context.spec.ts @@ -167,13 +167,11 @@ describe('context', () => { withSnakeCaseKeys({ camelCase: 1, nestedKey: { 'kebab-case': 'helloWorld', array: [{ camelCase: 1 }, { camelCase: 2 }] }, - nullValue: null, }) ).toEqual({ camel_case: 1, nested_key: { kebab_case: 'helloWorld', array: [{ camel_case: 1 }, { camel_case: 2 }] }, - null_value: null, }) }) diff --git a/packages/rum-core/src/boot/rumPublicApi.ts b/packages/rum-core/src/boot/rumPublicApi.ts index 34b5ea98ad..b341714bf7 100644 --- a/packages/rum-core/src/boot/rumPublicApi.ts +++ b/packages/rum-core/src/boot/rumPublicApi.ts @@ -119,7 +119,7 @@ export function makeRumPublicApi(startRumImpl: StartRum) { if (source === ErrorSource.CUSTOM || source === ErrorSource.NETWORK || source === ErrorSource.SOURCE) { checkedSource = source } else { - console.error(`DD_RUM.addError: Invalid source '${(source as any) as string}'`) + console.error(`DD_RUM.addError: Invalid source '${source as string}'`) checkedSource = ErrorSource.CUSTOM } addErrorStrategy({ diff --git a/packages/rum-core/src/domain/tracing/tracer.spec.ts b/packages/rum-core/src/domain/tracing/tracer.spec.ts index 31d0c58a40..4fa22b5d45 100644 --- a/packages/rum-core/src/domain/tracing/tracer.spec.ts +++ b/packages/rum-core/src/domain/tracing/tracer.spec.ts @@ -41,7 +41,6 @@ describe('tracer', () => { setRequestHeader(this: XhrStub, name: string, value: string) { this.headers[name] = value }, - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions headers: {} as XhrStub['headers'], } }) diff --git a/packages/rum-core/src/domain/trackPageActivities.spec.ts b/packages/rum-core/src/domain/trackPageActivities.spec.ts index 9839e02116..877203b7c6 100644 --- a/packages/rum-core/src/domain/trackPageActivities.spec.ts +++ b/packages/rum-core/src/domain/trackPageActivities.spec.ts @@ -103,7 +103,7 @@ describe('trackPagePageActivities', () => { describe('requests', () => { function makeFakeRequestCompleteEvent(requestIndex: number) { - return ({ requestIndex } as any) as RequestCompleteEvent + return { requestIndex } as RequestCompleteEvent } it('emits an activity event when a request starts', () => { const lifeCycle = new LifeCycle() diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index 7bf4196c7c..98a6e115aa 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -414,7 +414,6 @@ function initFontObserver(cb: FontCallback): ListenerHandler { ) handlers.push(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any ;(window as any).FonFace = originalFontFace }) handlers.push(restoreHandler) diff --git a/test/e2e/lib/helpers/browser.ts b/test/e2e/lib/helpers/browser.ts index 4894c9888a..56c0e559a9 100644 --- a/test/e2e/lib/helpers/browser.ts +++ b/test/e2e/lib/helpers/browser.ts @@ -54,7 +54,6 @@ export async function sendXhr(url: string, headers: string[][] = []): Promise { const xhr = new XMLHttpRequest() xhr.addEventListener('load', () => done({ state: 'success', response: xhr.response as string })) diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index 44f6cbec3b..62887de32b 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -31,8 +31,7 @@ describe('tracing', () => { }) checkRequestHeaders(rawHeaders) await flushEvents() - // eslint-disable-next-line @typescript-eslint/await-thenable - await checkTraceAssociatedToRumEvent(events) + checkTraceAssociatedToRumEvent(events) }) createTest('trace fetch with Request argument') From c72e4491869dfd1c9a2edd31067940002bcb7ecf Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 15:05:02 +0100 Subject: [PATCH 46/69] Use Regexp.test() instead of .exec() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benoît --- packages/core/src/tools/specHelper.ts | 4 ++-- .../src/domain/rumEventsCollection/resource/resourceUtils.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/tools/specHelper.ts b/packages/core/src/tools/specHelper.ts index ae8c50d3a1..d7de01400d 100644 --- a/packages/core/src/tools/specHelper.ts +++ b/packages/core/src/tools/specHelper.ts @@ -27,8 +27,8 @@ export function isFirefox() { } export function isIE() { - const hasIEAgent = /Trident.*rv\:11\./.exec(navigator.userAgent) - return navigator.userAgent.indexOf('MSIE ') > 0 || !!hasIEAgent + const hasIEAgent = /Trident.*rv\:11\./.test(navigator.userAgent) + return navigator.userAgent.indexOf('MSIE ') > 0 || hasIEAgent } export function clearAllCookies() { diff --git a/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts b/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts index ed3f743594..4ddb53595c 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/resource/resourceUtils.ts @@ -31,8 +31,8 @@ const RESOURCE_TYPES: Array<[ResourceType, (initiatorType: string, path: string) [ResourceType.XHR, (initiatorType: string) => 'xmlhttprequest' === initiatorType], [ResourceType.FETCH, (initiatorType: string) => 'fetch' === initiatorType], [ResourceType.BEACON, (initiatorType: string) => 'beacon' === initiatorType], - [ResourceType.CSS, (_: string, path: string) => /\.css$/i.exec(path) !== null], - [ResourceType.JS, (_: string, path: string) => /\.js$/i.exec(path) !== null], + [ResourceType.CSS, (_: string, path: string) => /\.css$/i.test(path)], + [ResourceType.JS, (_: string, path: string) => /\.js$/i.test(path)], [ ResourceType.IMAGE, (initiatorType: string, path: string) => From 8ddaa7a4fcb4252c41bb58a2f11eb3ef028882d6 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:06:15 +0100 Subject: [PATCH 47/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20useless=20void=20?= =?UTF-8?q?operator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/browser/fetchProxy.spec.ts | 32 +++++++++---------- .../domain/automaticErrorCollection.spec.ts | 14 ++++---- .../src/domain/requestCollection.spec.ts | 10 +++--- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/core/src/browser/fetchProxy.spec.ts b/packages/core/src/browser/fetchProxy.spec.ts index bb3015c235..5f71430463 100644 --- a/packages/core/src/browser/fetchProxy.spec.ts +++ b/packages/core/src/browser/fetchProxy.spec.ts @@ -29,7 +29,7 @@ describe('fetch proxy', () => { }) it('should track server error', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -42,7 +42,7 @@ describe('fetch proxy', () => { }) it('should track refused fetch', (done) => { - void fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) + fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -56,7 +56,7 @@ describe('fetch proxy', () => { // https://fetch.spec.whatwg.org/#concept-body-consume-body it('should track fetch with response text error', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 200, responseTextError: new Error('locked') }) + fetchStub(FAKE_URL).resolveWith({ status: 200, responseTextError: new Error('locked') }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -70,7 +70,7 @@ describe('fetch proxy', () => { it('should track opaque fetch', (done) => { // https://fetch.spec.whatwg.org/#concept-filtered-response-opaque - void fetchStub(FAKE_URL).resolveWith({ status: 0, type: 'opaque' }) + fetchStub(FAKE_URL).resolveWith({ status: 0, type: 'opaque' }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -82,7 +82,7 @@ describe('fetch proxy', () => { }) it('should track client error', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 400, responseText: 'Not found' }) + fetchStub(FAKE_URL).resolveWith({ status: 400, responseText: 'Not found' }) fetchStubManager.whenAllComplete(() => { const request = getRequest(0) @@ -95,12 +95,12 @@ describe('fetch proxy', () => { }) it('should get method from input', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 500 }) - void fetchStub(new Request(FAKE_URL)).resolveWith({ status: 500 }) - void fetchStub(new Request(FAKE_URL, { method: 'PUT' })).resolveWith({ status: 500 }) - void fetchStub(new Request(FAKE_URL, { method: 'PUT' }), { method: 'POST' }).resolveWith({ status: 500 }) - void fetchStub(new Request(FAKE_URL), { method: 'POST' }).resolveWith({ status: 500 }) - void fetchStub(FAKE_URL, { method: 'POST' }).resolveWith({ status: 500 }) + fetchStub(FAKE_URL).resolveWith({ status: 500 }) + fetchStub(new Request(FAKE_URL)).resolveWith({ status: 500 }) + fetchStub(new Request(FAKE_URL, { method: 'PUT' })).resolveWith({ status: 500 }) + fetchStub(new Request(FAKE_URL, { method: 'PUT' }), { method: 'POST' }).resolveWith({ status: 500 }) + fetchStub(new Request(FAKE_URL), { method: 'POST' }).resolveWith({ status: 500 }) + fetchStub(FAKE_URL, { method: 'POST' }).resolveWith({ status: 500 }) fetchStubManager.whenAllComplete(() => { expect(getRequest(0).method).toEqual('GET') @@ -114,8 +114,8 @@ describe('fetch proxy', () => { }) it('should get url from input', (done) => { - void fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) - void fetchStub(new Request(FAKE_URL)).rejectWith(new Error('fetch error')) + fetchStub(FAKE_URL).rejectWith(new Error('fetch error')) + fetchStub(new Request(FAKE_URL)).rejectWith(new Error('fetch error')) fetchStubManager.whenAllComplete(() => { expect(getRequest(0).url).toEqual(FAKE_URL) @@ -128,7 +128,7 @@ describe('fetch proxy', () => { const fetchStubPromise = fetchStub(FAKE_URL) const spy = jasmine.createSpy() void fetchStubPromise.then(spy) - void fetchStubPromise.resolveWith({ status: 500 }) + fetchStubPromise.resolveWith({ status: 500 }) setTimeout(() => { expect(spy).toHaveBeenCalled() @@ -140,7 +140,7 @@ describe('fetch proxy', () => { const fetchStubPromise = fetchStub(FAKE_URL) const spy = jasmine.createSpy() fetchStubPromise.catch(spy) - void fetchStubPromise.rejectWith(new Error('fetch error')) + fetchStubPromise.rejectWith(new Error('fetch error')) setTimeout(() => { expect(spy).toHaveBeenCalled() @@ -152,7 +152,7 @@ describe('fetch proxy', () => { fetchProxy.beforeSend((context) => { context.foo = 'bar' }) - void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { expect(getRequest(0).foo).toBe('bar') diff --git a/packages/core/src/domain/automaticErrorCollection.spec.ts b/packages/core/src/domain/automaticErrorCollection.spec.ts index 653e2fca79..5196023ce1 100644 --- a/packages/core/src/domain/automaticErrorCollection.spec.ts +++ b/packages/core/src/domain/automaticErrorCollection.spec.ts @@ -153,7 +153,7 @@ describe('network error tracker', () => { }) it('should track server error', (done) => { - void fetchStub(FAKE_URL).resolveWith(DEFAULT_REQUEST) + fetchStub(FAKE_URL).resolveWith(DEFAULT_REQUEST) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).toHaveBeenCalledWith({ @@ -172,7 +172,7 @@ describe('network error tracker', () => { }) it('should not track intake error', (done) => { - void fetchStub('https://logs-intake.com/v1/input/send?foo=bar').resolveWith(DEFAULT_REQUEST) + fetchStub('https://logs-intake.com/v1/input/send?foo=bar').resolveWith(DEFAULT_REQUEST) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).not.toHaveBeenCalled() @@ -181,7 +181,7 @@ describe('network error tracker', () => { }) it('should track refused request', (done) => { - void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 0 }) + fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 0 }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).toHaveBeenCalled() @@ -190,7 +190,7 @@ describe('network error tracker', () => { }) it('should not track client error', (done) => { - void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 400 }) + fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 400 }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).not.toHaveBeenCalled() @@ -199,7 +199,7 @@ describe('network error tracker', () => { }) it('should not track successful request', (done) => { - void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 200 }) + fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, status: 200 }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).not.toHaveBeenCalled() @@ -208,7 +208,7 @@ describe('network error tracker', () => { }) it('should add a default error response', (done) => { - void fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, responseText: undefined }) + fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, responseText: undefined }) fetchStubManager.whenAllComplete(() => { expect(errorObservableSpy).toHaveBeenCalled() @@ -219,7 +219,7 @@ describe('network error tracker', () => { }) it('should truncate error response', (done) => { - void fetchStub(FAKE_URL).resolveWith({ + fetchStub(FAKE_URL).resolveWith({ ...DEFAULT_REQUEST, responseText: 'Lorem ipsum dolor sit amet orci aliquam.', }) diff --git a/packages/rum-core/src/domain/requestCollection.spec.ts b/packages/rum-core/src/domain/requestCollection.spec.ts index 51ce438a35..32d41e5221 100644 --- a/packages/rum-core/src/domain/requestCollection.spec.ts +++ b/packages/rum-core/src/domain/requestCollection.spec.ts @@ -59,7 +59,7 @@ describe('collect fetch', () => { }) it('should notify on request start', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { expect(startSpy).toHaveBeenCalledWith({ requestIndex: (jasmine.any(Number) as unknown) as number }) @@ -68,7 +68,7 @@ describe('collect fetch', () => { }) it('should notify on request complete', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { const request = completeSpy.calls.argsFor(0)[0] @@ -83,7 +83,7 @@ describe('collect fetch', () => { }) it('should not trace cancelled requests', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 0, responseText: 'fetch cancelled' }) + fetchStub(FAKE_URL).resolveWith({ status: 0, responseText: 'fetch cancelled' }) fetchStubManager.whenAllComplete(() => { const request = completeSpy.calls.argsFor(0)[0] @@ -95,7 +95,7 @@ describe('collect fetch', () => { }) it('should assign a request id', (done) => { - void fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) + fetchStub(FAKE_URL).resolveWith({ status: 500, responseText: 'fetch error' }) fetchStubManager.whenAllComplete(() => { const startRequestIndex = startSpy.calls.argsFor(0)[0].requestIndex @@ -107,7 +107,7 @@ describe('collect fetch', () => { }) it('should ignore intake requests', (done) => { - void fetchStub(SPEC_ENDPOINTS.rumEndpoint!).resolveWith({ status: 200, responseText: 'foo' }) + fetchStub(SPEC_ENDPOINTS.rumEndpoint!).resolveWith({ status: 200, responseText: 'foo' }) fetchStubManager.whenAllComplete(() => { expect(startSpy).not.toHaveBeenCalled() From f686c078a39d285c7e4ca5fe928cf2188fc0d8e6 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:20:46 +0100 Subject: [PATCH 48/69] =?UTF-8?q?=F0=9F=91=8C=20Handle=20the=20promise=20c?= =?UTF-8?q?orrectly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/browser/fetchProxy.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/browser/fetchProxy.spec.ts b/packages/core/src/browser/fetchProxy.spec.ts index 5f71430463..d60996e7d3 100644 --- a/packages/core/src/browser/fetchProxy.spec.ts +++ b/packages/core/src/browser/fetchProxy.spec.ts @@ -127,7 +127,9 @@ describe('fetch proxy', () => { it('should keep promise resolved behavior', (done) => { const fetchStubPromise = fetchStub(FAKE_URL) const spy = jasmine.createSpy() - void fetchStubPromise.then(spy) + fetchStubPromise.then(spy).catch(() => { + expect(false).toBe(true, 'Should not have thrown an error!') + }) fetchStubPromise.resolveWith({ status: 500 }) setTimeout(() => { From f1ee1823b26c927f0f80128aef2a546a995d8cf4 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:27:17 +0100 Subject: [PATCH 49/69] =?UTF-8?q?=F0=9F=91=8C=20Ignore=20the=20rule=20for?= =?UTF-8?q?=20the=20entire=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/browser/xhrProxy.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/src/browser/xhrProxy.ts b/packages/core/src/browser/xhrProxy.ts index dacf2b1cce..34c5fda7ca 100644 --- a/packages/core/src/browser/xhrProxy.ts +++ b/packages/core/src/browser/xhrProxy.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-underscore-dangle */ import { monitor } from '../domain/internalMonitoring' import { normalizeUrl } from '../tools/urlPolyfill' @@ -69,7 +70,6 @@ function proxyXhr() { originalXhrOpen = XMLHttpRequest.prototype.open // eslint-disable-next-line @typescript-eslint/unbound-method originalXhrSend = XMLHttpRequest.prototype.send - /* eslint-disable no-underscore-dangle */ XMLHttpRequest.prototype.open = monitor(function (this: BrowserXHR, method: string, url: string) { // WARN: since this data structure is tied to the instance, it is shared by both logs and rum // and can be used by different code versions depending on customer setup @@ -119,5 +119,4 @@ function proxyXhr() { return originalXhrSend.apply(this, arguments as any) }) - /* eslint-enable no-underscore-dangle */ } From 3832333751250d6060ef3208b81b9833513d8fe6 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:28:10 +0100 Subject: [PATCH 50/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20useless=20type=20?= =?UTF-8?q?cast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/domain/internalMonitoring.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index cc6a88baf9..10cd54b057 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -101,10 +101,10 @@ export function monitored unknown>( descriptor: TypedPropertyDescriptor ) { const originalMethod = descriptor.value! - descriptor.value = (function (this: any, ...args: Parameters) { + descriptor.value = function (this: any, ...args: Parameters) { const decorated = monitoringConfiguration.batch ? monitor(originalMethod) : originalMethod return decorated.apply(this, args) as ReturnType - } as any) as T + } as T } export function monitor(fn: (...args: any[]) => R) { From 2547539bcbab3a22a96b023b42802e6e5635ded4 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:35:03 +0100 Subject: [PATCH 51/69] =?UTF-8?q?=F0=9F=91=8C=20Restore=20original=20monit?= =?UTF-8?q?or=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/domain/internalMonitoring.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/core/src/domain/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring.ts index 10cd54b057..92c9ae0562 100644 --- a/packages/core/src/domain/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring.ts @@ -107,19 +107,20 @@ export function monitored unknown>( } as T } -export function monitor(fn: (...args: any[]) => R) { - return (function (this: any, ...args: any[]) { +export function monitor any>(fn: T): T { + return (function (this: any) { try { - return fn.apply(this, args) + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return fn.apply(this, arguments as any) } catch (e) { logErrorIfDebug(e) try { addErrorToMonitoringBatch(e) - } catch (err) { - logErrorIfDebug(err) + } catch (e) { + logErrorIfDebug(e) } } - } as unknown) as (...args: any[]) => R // consider output type has input type + } as unknown) as T // consider output type has input type } export function addMonitoringMessage(message: string, context?: Context) { From 5b3c3c1bc57ebe57fb85911b58fd337f070ac964 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:51:31 +0100 Subject: [PATCH 52/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20unused=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/domain/tracekit.ts | 31 ---------------------------- 1 file changed, 31 deletions(-) diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index ad47351daa..fc43d0930a 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -960,34 +960,3 @@ export const computeStackTrace = (function computeStackTraceWrapper() { return doComputeStackTrace })() - -/** - * Extends support for global error handling for asynchronous browser - * functions. Adopted from Closure Library's errorhandler.js - * @memberof TraceKit - */ -export function extendToAsynchronousCallbacks() { - function helper(fnName: any) { - const originalFn = (window as any)[fnName] as (...args: any[]) => any - ;(window as any)[fnName] = function traceKitAsyncExtension() { - // Make a copy of the arguments - const args: any[] = [].slice.call(arguments) - const originalCallback = args[0] - if (typeof originalCallback === 'function') { - args[0] = wrap(originalCallback) - } - // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it - // also only supports 2 argument and doesn't care what "this" is, so we - // can just call the original function directly. - if (originalFn.apply) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-return - return originalFn.apply(this, args) - } - // eslint-disable-next-line @typescript-eslint/no-unsafe-return - return originalFn(args[0], args[1]) - } - } - - helper('setTimeout') - helper('setInterval') -} From 6adc190a5e5545d55001c81d7c0a33b9c78b22ce Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 12:58:00 +0100 Subject: [PATCH 53/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20unused=20rule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/tools/specHelper.ts | 4 ++-- packages/core/src/tools/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/tools/specHelper.ts b/packages/core/src/tools/specHelper.ts index d7de01400d..2cc0ca26ee 100644 --- a/packages/core/src/tools/specHelper.ts +++ b/packages/core/src/tools/specHelper.ts @@ -121,10 +121,10 @@ class StubXhr { this.fakeEventTarget = document.createElement('div') } - /* eslint-disable no-empty,@typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars */ + /* eslint-disable @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars */ open(method: string, url: string) {} send() {} - /* eslint-enable no-empty,@typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars */ + /* eslint-enable @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars */ abort() { this.status = 0 diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 5c5ddca310..4f102921c1 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -121,7 +121,7 @@ export function msToNs(duration: number | T): number | T { return round(duration * 1e6, 0) } -// eslint-disable-next-line no-empty,@typescript-eslint/no-empty-function +// eslint-disable-next-line @typescript-eslint/no-empty-function export function noop() {} interface ObjectWithToJSON { From 3d4f9796abffe8b6a2ec13b880af7f05d08eae2f Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 13:01:57 +0100 Subject: [PATCH 54/69] =?UTF-8?q?=F0=9F=91=8C=20Refactor=20jsdoc=20comment?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/tools/utils.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/core/src/tools/utils.ts b/packages/core/src/tools/utils.ts index 4f102921c1..a81df7207d 100644 --- a/packages/core/src/tools/utils.ts +++ b/packages/core/src/tools/utils.ts @@ -340,9 +340,7 @@ interface AddEventListenerOptions { * Add an event listener to an event emitter object (Window, Element, mock object...). This provides * a few conveniences compared to using `element.addEventListener` directly: * - * * supports IE11 by: - * - using an option object only if needed - * - emulating the `once` option + * * supports IE11 by: using an option object only if needed and emulating the `once` option * * * wraps the listener with a `monitor` function * @@ -361,9 +359,7 @@ export function addEventListener( * Add event listeners to an event emitter object (Window, Element, mock object...). This provides * a few conveniences compared to using `element.addEventListener` directly: * - * * supports IE11 by: - * - using an option object only if needed - * - emulating the `once` option + * * supports IE11 by: using an option object only if needed and emulating the `once` option * * * wraps the listener with a `monitor` function * From fd49cec1aeb01cdfceae84acd683f9877e31b562 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 13:04:10 +0100 Subject: [PATCH 55/69] =?UTF-8?q?=F0=9F=91=8C=20Ignore=20the=20rule=20for?= =?UTF-8?q?=20the=20entire=20test=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/transport/transport.spec.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/packages/core/src/transport/transport.spec.ts b/packages/core/src/transport/transport.spec.ts index 034415e4a8..1865fe91e3 100644 --- a/packages/core/src/transport/transport.spec.ts +++ b/packages/core/src/transport/transport.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/unbound-method */ import sinon from 'sinon' import { noop } from '../tools/utils' @@ -31,7 +32,6 @@ describe('request', () => { request.send('{"foo":"bar1"}\n{"foo":"bar2"}', 10) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(navigator.sendBeacon).toHaveBeenCalled() }) @@ -50,7 +50,6 @@ describe('request', () => { request.send('{"foo":"bar1"}\n{"foo":"bar2"}', 10) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(navigator.sendBeacon).toHaveBeenCalled() expect(server.requests.length).toEqual(1) }) @@ -75,7 +74,6 @@ describe('batch', () => { batch.flush() - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"hello"}', jasmine.any(Number)) }) @@ -83,11 +81,9 @@ describe('batch', () => { batch.add({ message: 'hello' }) batch.flush() - // eslint-disable-next-line @typescript-eslint/unbound-method ;(transport.send as jasmine.Spy).calls.reset() batch.flush() - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).not.toHaveBeenCalled() }) @@ -103,7 +99,6 @@ describe('batch', () => { batch.add({ message: '1' }) batch.add({ message: '2' }) batch.add({ message: '3' }) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith( '{"message":"1"}\n{"message":"2"}\n{"message":"3"}', jasmine.any(Number) @@ -112,15 +107,12 @@ describe('batch', () => { it('should flush when new message will overflow bytes limit', () => { batch.add({ message: '50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx' }) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).not.toHaveBeenCalled() batch.add({ message: '60 bytes - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' }) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx"}', 50) batch.flush() - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"60 bytes - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}', 60) }) @@ -129,14 +121,12 @@ describe('batch', () => { batch.add({ message: '30 bytes - xxxxx' }) // batch: 60 sep: 1 batch.add({ message: '39 bytes - xxxxxxxxxxxxxx' }) // batch: 99 sep: 2 - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"30 bytes - xxxxx"}\n{"message":"30 bytes - xxxxx"}', 61) }) it('should call send one time when the size is too high and the batch is empty', () => { const message = '101 bytes - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' batch.add({ message }) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith(`{"message":"${message}"}`, 101) }) @@ -145,7 +135,6 @@ describe('batch', () => { batch.add({ message: '50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx' }) batch.add({ message }) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledTimes(2) }) @@ -155,7 +144,6 @@ describe('batch', () => { batch.add({ message: '50 bytes - xxxxxxxxxxxxxxxxxxxxxxxxx' }) clock.tick(100) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalled() clock.restore() @@ -166,7 +154,6 @@ describe('batch', () => { batch = new Batch(transport, MAX_SIZE, BATCH_BYTES_LIMIT, 50, FLUSH_TIMEOUT) batch.add({ message: '50 bytes - xxxxxxxxxxxxx' }) - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).not.toHaveBeenCalled() warnStub.restore() }) @@ -177,7 +164,6 @@ describe('batch', () => { batch.upsert({ message: '3' }, 'b') batch.upsert({ message: '4' }, 'c') - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith( '{"message":"2"}\n{"message":"3"}\n{"message":"4"}', jasmine.any(Number) @@ -187,7 +173,6 @@ describe('batch', () => { batch.upsert({ message: '6' }, 'b') batch.upsert({ message: '7' }, 'a') - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith( '{"message":"5"}\n{"message":"6"}\n{"message":"7"}', jasmine.any(Number) @@ -199,7 +184,6 @@ describe('batch', () => { batch.upsert({ message: '11' }, 'b') batch.flush() - // eslint-disable-next-line @typescript-eslint/unbound-method expect(transport.send).toHaveBeenCalledWith('{"message":"10"}\n{"message":"11"}', jasmine.any(Number)) }) }) From 1ab9bf4897f55cf67a57a7c5787f8786e4bbbcf9 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 13:06:55 +0100 Subject: [PATCH 56/69] =?UTF-8?q?=F0=9F=91=8C=20Ignore=20the=20rule=20only?= =?UTF-8?q?=20when=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/test/capturedExceptions.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/core/test/capturedExceptions.ts b/packages/core/test/capturedExceptions.ts index 9283ef2b41..8f8137c4b7 100644 --- a/packages/core/test/capturedExceptions.ts +++ b/packages/core/test/capturedExceptions.ts @@ -1,4 +1,3 @@ -/* eslint-disable max-len */ export const OPERA_854 = { message: `Statement on line 44: Type mismatch (usually a non-object value used where an object is required) Backtrace: @@ -384,19 +383,21 @@ export const PHANTOMJS_1_19 = { at http://path/to/file.js:4287`, } +/* eslint-disable max-len */ export const ANDROID_REACT_NATIVE = { message: 'Error: test', name: 'Error', stack: `Error: test -at render(/home/username/sample-workspace/sampleapp.collect.react/src/components/GpsMonitorScene.js:78:24) -at _renderValidatedComponentWithoutOwnerOrContext(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1050:29) -at _renderValidatedComponent(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1075:15) -at renderedElement(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:484:29) -at _currentElement(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40) -at child(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25) -at children(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10) -at this(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)\n`, -} + at render(/home/username/sample-workspace/sampleapp.collect.react/src/components/GpsMonitorScene.js:78:24) + at _renderValidatedComponentWithoutOwnerOrContext(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1050:29) + at _renderValidatedComponent(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1075:15) + at renderedElement(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:484:29) + at _currentElement(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40) + at child(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25) + at children(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10) + at this(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)\n`, +} +/* eslint-enable max-len */ export const ANDROID_REACT_NATIVE_PROD = { message: 'Error: test', From ed9bad34401b9b244f23f46ef92a73047d7d943d Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 13:25:08 +0100 Subject: [PATCH 57/69] =?UTF-8?q?=F0=9F=91=8C=20Regenrate=20rumEvent.types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/rum-core/src/rumEvent.types.ts | 2 +- scripts/generate-schema-types.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rum-core/src/rumEvent.types.ts b/packages/rum-core/src/rumEvent.types.ts index b7a7252788..2a4f8089d1 100644 --- a/packages/rum-core/src/rumEvent.types.ts +++ b/packages/rum-core/src/rumEvent.types.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/array-type */ +/* eslint-disable */ /** * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead. */ diff --git a/scripts/generate-schema-types.js b/scripts/generate-schema-types.js index 3b449e59d6..0f61177fb4 100644 --- a/scripts/generate-schema-types.js +++ b/scripts/generate-schema-types.js @@ -14,7 +14,7 @@ async function main() { const compiledTypes = await compileFromFile(schemaPath, { cwd: workingDirectory, bannerComment: - '/* eslint disable */\n/**\n * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead.\n*/', + '/* eslint-disable */\n/**\n * DO NOT MODIFY IT BY HAND. Run `yarn rum-events-format:sync` instead.\n*/', style: prettierConfig, }) console.log(`writing ${compiledTypesPath}`) From 0c9c76d9376ef443c196221074bfc4ba23841fa8 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 15:27:57 +0100 Subject: [PATCH 58/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20uneeded=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/rum-recorder/src/domain/rrweb/observer.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/rum-recorder/src/domain/rrweb/observer.ts b/packages/rum-recorder/src/domain/rrweb/observer.ts index 98a6e115aa..092c2cdc63 100644 --- a/packages/rum-recorder/src/domain/rrweb/observer.ts +++ b/packages/rum-recorder/src/domain/rrweb/observer.ts @@ -388,11 +388,7 @@ function initFontObserver(cb: FontCallback): ListenerHandler { descriptors, family, buffer: typeof source !== 'string', - fontSource: - typeof source === 'string' - ? source - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - JSON.stringify(Array.from(new Uint8Array(source as any))), + fontSource: typeof source === 'string' ? source : JSON.stringify(Array.from(new Uint8Array(source as any))), }) return fontFace } as unknown) as typeof FontFace From c4b56267681bd436564b13bd6ad13b741dca8d19 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 16:05:20 +0100 Subject: [PATCH 59/69] =?UTF-8?q?=F0=9F=91=8C=20Log=20fetch=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/scenario/logs.scenario.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/e2e/scenario/logs.scenario.ts b/test/e2e/scenario/logs.scenario.ts index a9808dd276..5f469a3c01 100644 --- a/test/e2e/scenario/logs.scenario.ts +++ b/test/e2e/scenario/logs.scenario.ts @@ -50,10 +50,16 @@ describe('logs', () => { .run(async ({ events, baseUrl }) => { await browserExecuteAsync((unreachableUrl, done) => { let count = 0 - void fetch(`/throw`).then(() => (count += 1)) - void fetch(`/unknown`).then(() => (count += 1)) + fetch(`/throw`) + .then(() => (count += 1)) + .catch((err) => console.error(err)) + fetch(`/unknown`) + .then(() => (count += 1)) + .catch((err) => console.error(err)) fetch(unreachableUrl).catch(() => (count += 1)) - void fetch(`/ok`).then(() => (count += 1)) + fetch(`/ok`) + .then(() => (count += 1)) + .catch((err) => console.error(err)) const interval = setInterval(() => { if (count === 4) { From ce62e602dac981bdb8aaf8dd577f6bc3f4dcd4c1 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 16:11:42 +0100 Subject: [PATCH 60/69] =?UTF-8?q?=F0=9F=91=8C=20Handle=20fetch=20promise?= =?UTF-8?q?=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/scenario/rum/tracing.scenario.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index 62887de32b..7412b201f7 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -19,7 +19,7 @@ describe('tracing', () => { .withRum({ service: 'Service', allowedTracingOrigins: ['LOCATION_ORIGIN'] }) .run(async ({ events }) => { const rawHeaders = await browserExecuteAsync((done) => { - void window + window .fetch('/headers', { headers: [ ['x-foo', 'bar'], @@ -28,6 +28,7 @@ describe('tracing', () => { }) .then((response) => response.text()) .then(done) + .catch(() => done('{}')) }) checkRequestHeaders(rawHeaders) await flushEvents() @@ -38,10 +39,11 @@ describe('tracing', () => { .withRum({ service: 'Service', allowedTracingOrigins: ['LOCATION_ORIGIN'] }) .run(async ({ events }) => { const rawHeaders = await browserExecuteAsync((done) => { - void window + window .fetch(new Request('/headers', { headers: { 'x-foo': 'bar, baz' } })) .then((response) => response.text()) .then(done) + .catch(() => done('{}')) }) checkRequestHeaders(rawHeaders) await flushEvents() From 1ab5aa425b7a7cb1916d88245821cc8daae43658 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 16:31:04 +0100 Subject: [PATCH 61/69] =?UTF-8?q?=F0=9F=91=8C=20Simplify=20tsconfigs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/tsconfig.json | 3 +-- tsconfig.json | 11 ++--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/test/e2e/tsconfig.json b/test/e2e/tsconfig.json index 80d81e4047..8821ec302d 100644 --- a/test/e2e/tsconfig.json +++ b/test/e2e/tsconfig.json @@ -14,6 +14,5 @@ "@datadog/browser-rum-recorder": ["../../packages/rum-recorder/src"], "@datadog/browser-core": ["../../packages/core/src"] } - }, - "include": ["./*.js", "./**/*.js", "./scenario/**/*.ts", "./lib/**/*.ts", "./*.d.ts"] + } } diff --git a/tsconfig.json b/tsconfig.json index d8647d01f1..9e148a13d6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,6 @@ // This tsconfig is only used for tooling (ex: typecheck in code editors) { "extends": "./tsconfig.base.json", - "include": [ - "./*.js", - "./packages/**/*.js", - "./packages/**/*.ts", - "./scripts/**/*.js", - "./test/*.js", - "./test/unit/*.js", - "./.eslintrc.js" - ] + "include": [".", ".eslintrc.js"], + "exclude": ["./test/e2e"] } From 11afd6d4df8cac89eb69d3e79572c75ab0f8f913 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 16:35:10 +0100 Subject: [PATCH 62/69] =?UTF-8?q?=F0=9F=91=8C=20Undo=20uneeded=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.base.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webpack.base.js b/webpack.base.js index e762ae05db..8d333ce6d3 100644 --- a/webpack.base.js +++ b/webpack.base.js @@ -51,10 +51,10 @@ module.exports = ({ entry, mode, filename, datacenter }) => ({ plugins: [ new BannerPlugin({ - banner({ filename: fileName }) { - const env = fileName.match(SUFFIX_REGEXP)[1] - const newFileName = fileName.replace(SUFFIX_REGEXP, '') - return `\n${fileName} IS DEPRECATED, USE ${newFileName} WITH { site: 'datadoghq.${ + banner({ filename }) { + const env = filename.match(SUFFIX_REGEXP)[1] + const newFileName = filename.replace(SUFFIX_REGEXP, '') + return `\n${filename} IS DEPRECATED, USE ${newFileName} WITH { site: 'datadoghq.${ env === 'eu' ? 'eu' : 'com' }' } INIT CONFIGURATION INSTEAD\n` }, From 930aec01521c017e43e3f9d384bcc4895e2109d7 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Fri, 22 Jan 2021 16:43:22 +0100 Subject: [PATCH 63/69] Fix typescript config --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 9e148a13d6..f17ac6af2f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,5 +2,5 @@ { "extends": "./tsconfig.base.json", "include": [".", ".eslintrc.js"], - "exclude": ["./test/e2e"] + "exclude": ["./test/e2e", "./test/app"] } From c1ee3cd5903a78496eaed1fadf4197b11e4c63e8 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 25 Jan 2021 11:16:12 +0100 Subject: [PATCH 64/69] =?UTF-8?q?=F0=9F=91=8C=20Use=20spaced=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 13 +- packages/core/src/domain/sessionManagement.ts | 7 +- packages/core/src/domain/tracekit.spec.ts | 2 +- packages/core/src/domain/tracekit.ts | 2 +- .../rum-recorder/src/domain/deflateWorker.js | 282 +++++++++--------- 5 files changed, 157 insertions(+), 149 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ebc471fa54..40a86216bf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -180,7 +180,18 @@ module.exports = { 'require-await': 'off', 'space-before-function-paren': 'off', 'space-in-parens': ['off', 'never'], - 'spaced-comment': ['error', 'always', { markers: ['/'] }], + 'spaced-comment': [ + 'error', + 'always', + { + line: { + markers: ['/'], + }, + block: { + balanced: true, + }, + }, + ], 'unicorn/filename-case': ['error', { case: 'camelCase' }], 'use-isnan': 'error', 'valid-typeof': 'off', diff --git a/packages/core/src/domain/sessionManagement.ts b/packages/core/src/domain/sessionManagement.ts index 8af92a26d7..627391b1c7 100644 --- a/packages/core/src/domain/sessionManagement.ts +++ b/packages/core/src/domain/sessionManagement.ts @@ -12,7 +12,7 @@ export const VISIBILITY_CHECK_DELAY = utils.ONE_MINUTE export interface Session { renewObservable: Observable getId: () => string | undefined - getTrackingType(): T | undefined + getTrackingType: () => T | undefined } export interface SessionState { @@ -64,10 +64,7 @@ export function startSessionManagement( return { getId: () => retrieveActiveSession(sessionCookie).id, - - getTrackingType() { - return retrieveActiveSession(sessionCookie)[productKey] as TrackingType | undefined - }, + getTrackingType: () => retrieveActiveSession(sessionCookie)[productKey] as TrackingType | undefined, renewObservable, } } diff --git a/packages/core/src/domain/tracekit.spec.ts b/packages/core/src/domain/tracekit.spec.ts index 11b496cbbb..3b9322b0b0 100644 --- a/packages/core/src/domain/tracekit.spec.ts +++ b/packages/core/src/domain/tracekit.spec.ts @@ -256,7 +256,7 @@ Error: foo ;[false, true].forEach((callOnError) => { ;[1, 2].forEach((numReports) => { let title = 'it should receive arguments from report() when' - title += ` callOnError is ${callOnError ? 'true' : 'false'}` + title += ` callOnError is ${String(callOnError)}` title += ` and numReports is ${numReports}` it( title, diff --git a/packages/core/src/domain/tracekit.ts b/packages/core/src/domain/tracekit.ts index fc43d0930a..bde0c6ccbd 100644 --- a/packages/core/src/domain/tracekit.ts +++ b/packages/core/src/domain/tracekit.ts @@ -86,7 +86,7 @@ function isUndefined(what: any) { * @memberof TraceKit */ export function wrap(func: (...args: Args) => R) { - function wrapped(this: any, ...args: Args) { + function wrapped(this: unknown, ...args: Args) { try { return func.apply(this, args) } catch (e) { diff --git a/packages/rum-recorder/src/domain/deflateWorker.js b/packages/rum-recorder/src/domain/deflateWorker.js index 0dd2e9dc3c..ac8285d7eb 100644 --- a/packages/rum-recorder/src/domain/deflateWorker.js +++ b/packages/rum-recorder/src/domain/deflateWorker.js @@ -59,9 +59,9 @@ function workerCodeFn() { /* eslint-disable space-unary-ops */ - /* Public constants ==========================================================*/ + /* Public constants ========================================================== */ - /* ===========================================================================*/ + /* =========================================================================== */ // const Z_FILTERED = 1; // const Z_HUFFMAN_ONLY = 2; // const Z_RLE = 3; @@ -74,7 +74,7 @@ function workerCodeFn() { var Z_TEXT = 1 // const Z_ASCII = 1; // = Z_TEXT var Z_UNKNOWN = 2 - /* ============================================================================*/ + /* ============================================================================ */ function zero(buf) { var len = buf.length @@ -273,9 +273,9 @@ function workerCodeFn() { send_bits( s, tree[c * 2], - /* .Code*/ + /* .Code */ tree[c * 2 + 1] - /* .Len*/ + /* .Len */ ) } /* =========================================================================== @@ -359,7 +359,7 @@ function workerCodeFn() { */ tree[s.heap[s.heap_max] * 2 + 1] = - /* .Len*/ + /* .Len */ 0 /* root of the heap */ @@ -368,11 +368,11 @@ function workerCodeFn() { bits = tree[ tree[n * 2 + 1] * - /* .Dad*/ + /* .Dad */ 2 + 1 ] + - /* .Len*/ + /* .Len */ 1 if (bits > max_length) { @@ -381,7 +381,7 @@ function workerCodeFn() { } tree[n * 2 + 1] = - /* .Len*/ + /* .Len */ bits /* We overwrite tree[n].Dad which is no longer needed */ @@ -398,14 +398,14 @@ function workerCodeFn() { } f = tree[n * 2] - /* .Freq*/ + /* .Freq */ s.opt_len += f * (bits + xbits) if (has_stree) { s.static_len += f * (stree[n * 2 + 1] + - /* .Len*/ + /* .Len */ xbits) } } @@ -456,17 +456,17 @@ function workerCodeFn() { if ( tree[m * 2 + 1] !== - /* .Len*/ + /* .Len */ bits ) { // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s.opt_len += (bits - tree[m * 2 + 1]) * - /* .Len*/ + /* .Len */ tree[m * 2] - /* .Freq*/ + /* .Freq */ tree[m * 2 + 1] = - /* .Len*/ + /* .Len */ bits } @@ -516,14 +516,14 @@ function workerCodeFn() { for (n = 0; n <= max_code; n++) { var len = tree[n * 2 + 1] - /* .Len*/ + /* .Len */ if (len === 0) { continue } /* Now reverse the bits */ tree[n * 2] = - /* .Code*/ + /* .Code */ bi_reverse(next_code[len]++, len) // Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); } @@ -561,7 +561,7 @@ function workerCodeFn() { static_d_desc.static_tree = static_dtree; static_d_desc.extra_bits = extra_dbits; static_bl_desc.extra_bits = extra_blbits; - #endif*/ + #endif */ /* Initialize the mapping length (0..255) -> length code (0..28) */ @@ -614,7 +614,7 @@ function workerCodeFn() { while (n <= 143) { static_ltree[n * 2 + 1] = - /* .Len*/ + /* .Len */ 8 n++ bl_count[8]++ @@ -622,7 +622,7 @@ function workerCodeFn() { while (n <= 255) { static_ltree[n * 2 + 1] = - /* .Len*/ + /* .Len */ 9 n++ bl_count[9]++ @@ -630,7 +630,7 @@ function workerCodeFn() { while (n <= 279) { static_ltree[n * 2 + 1] = - /* .Len*/ + /* .Len */ 7 n++ bl_count[7]++ @@ -638,7 +638,7 @@ function workerCodeFn() { while (n <= 287) { static_ltree[n * 2 + 1] = - /* .Len*/ + /* .Len */ 8 n++ bl_count[8]++ @@ -653,10 +653,10 @@ function workerCodeFn() { for (n = 0; n < D_CODES; n++) { static_dtree[n * 2 + 1] = - /* .Len*/ + /* .Len */ 5 static_dtree[n * 2] = - /* .Code*/ + /* .Code */ bi_reverse(n, 5) } // Now data ready and we can init static trees @@ -676,24 +676,24 @@ function workerCodeFn() { for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2] = - /* .Freq*/ + /* .Freq */ 0 } for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2] = - /* .Freq*/ + /* .Freq */ 0 } for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2] = - /* .Freq*/ + /* .Freq */ 0 } s.dyn_ltree[END_BLOCK * 2] = - /* .Freq*/ + /* .Freq */ 1 s.opt_len = s.static_len = 0 s.last_lit = s.matches = 0 @@ -749,13 +749,13 @@ function workerCodeFn() { return ( tree[_n2] < - /* .Freq*/ + /* .Freq */ tree[_m2] || - /* .Freq*/ + /* .Freq */ (tree[_n2] === - /* .Freq*/ + /* .Freq */ tree[_m2] && - /* .Freq*/ + /* .Freq */ depth[n] <= depth[m]) ) } @@ -910,14 +910,14 @@ function workerCodeFn() { for (n = 0; n < elems; n++) { if ( tree[n * 2] !== - /* .Freq*/ + /* .Freq */ 0 ) { s.heap[++s.heap_len] = max_code = n s.depth[n] = 0 } else { tree[n * 2 + 1] = - /* .Len*/ + /* .Len */ 0 } } @@ -930,14 +930,14 @@ function workerCodeFn() { while (s.heap_len < 2) { node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0 tree[node * 2] = - /* .Freq*/ + /* .Freq */ 1 s.depth[node] = 0 s.opt_len-- if (has_stree) { s.static_len -= stree[node * 2 + 1] - /* .Len*/ + /* .Len */ } /* node is 0 or 1 so it does not have extra bits */ } @@ -949,7 +949,7 @@ function workerCodeFn() { for ( n = s.heap_len >> 1; - /* int /2*/ + /* int /2 */ n >= 1; n-- ) { @@ -965,21 +965,21 @@ function workerCodeFn() { do { // pqremove(s, tree, n); /* n = node of least frequency */ - /** * pqremove ***/ + /** * pqremove ** */ n = s.heap[1] - /* SMALLEST*/ + /* SMALLEST */ s.heap[1] = s.heap[s.heap_len--] - /* SMALLEST*/ + /* SMALLEST */ pqdownheap( s, tree, 1 - /* SMALLEST*/ + /* SMALLEST */ ) /***/ m = s.heap[1] - /* SMALLEST*/ + /* SMALLEST */ /* m = node of next least frequency */ s.heap[--s.heap_max] = n @@ -989,31 +989,31 @@ function workerCodeFn() { /* Create a new node father of n and m */ tree[node * 2] = - /* .Freq*/ + /* .Freq */ tree[n * 2] + - /* .Freq*/ + /* .Freq */ tree[m * 2] - /* .Freq*/ + /* .Freq */ s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1 tree[n * 2 + 1] = - /* .Dad*/ + /* .Dad */ tree[m * 2 + 1] = - /* .Dad*/ + /* .Dad */ node /* and insert the new node in the heap */ s.heap[1] = node++ - /* SMALLEST*/ + /* SMALLEST */ pqdownheap( s, tree, 1 - /* SMALLEST*/ + /* SMALLEST */ ) } while (s.heap_len >= 2) s.heap[--s.heap_max] = s.heap[1] - /* SMALLEST*/ + /* SMALLEST */ /* At this point, the fields freq and dad are set. We can now * generate the bit lengths. */ @@ -1043,7 +1043,7 @@ function workerCodeFn() { /* length of current code */ var nextlen = tree[0 * 2 + 1] - /* .Len*/ + /* .Len */ /* length of next code */ var count = 0 @@ -1061,31 +1061,31 @@ function workerCodeFn() { } tree[(max_code + 1) * 2 + 1] = - /* .Len*/ + /* .Len */ 0xffff /* guard */ for (n = 0; n <= max_code; n++) { curlen = nextlen nextlen = tree[(n + 1) * 2 + 1] - /* .Len*/ + /* .Len */ if (++count < max_count && curlen === nextlen) { continue } else if (count < min_count) { s.bl_tree[curlen * 2] += - /* .Freq*/ + /* .Freq */ count } else if (curlen !== 0) { if (curlen !== prevlen) { - s.bl_tree[curlen * 2] /* .Freq*/++ + s.bl_tree[curlen * 2] /* .Freq */++ } - s.bl_tree[REP_3_6 * 2] /* .Freq*/++ + s.bl_tree[REP_3_6 * 2] /* .Freq */++ } else if (count <= 10) { - s.bl_tree[REPZ_3_10 * 2] /* .Freq*/++ + s.bl_tree[REPZ_3_10 * 2] /* .Freq */++ } else { - s.bl_tree[REPZ_11_138 * 2] /* .Freq*/++ + s.bl_tree[REPZ_11_138 * 2] /* .Freq */++ } count = 0 @@ -1123,7 +1123,7 @@ function workerCodeFn() { /* length of current code */ var nextlen = tree[0 * 2 + 1] - /* .Len*/ + /* .Len */ /* length of next code */ var count = 0 @@ -1147,7 +1147,7 @@ function workerCodeFn() { for (n = 0; n <= max_code; n++) { curlen = nextlen nextlen = tree[(n + 1) * 2 + 1] - /* .Len*/ + /* .Len */ if (++count < max_count && curlen === nextlen) { continue @@ -1214,7 +1214,7 @@ function workerCodeFn() { for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { if ( s.bl_tree[bl_order[max_blindex] * 2 + 1] !== - /* .Len*/ + /* .Len */ 0 ) { break @@ -1258,7 +1258,7 @@ function workerCodeFn() { send_bits( s, s.bl_tree[bl_order[rank] * 2 + 1], - /* .Len*/ + /* .Len */ 3 ) } // Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); @@ -1298,7 +1298,7 @@ function workerCodeFn() { if ( black_mask & 1 && s.dyn_ltree[n * 2] !== - /* .Freq*/ + /* .Freq */ 0 ) { return Z_BINARY @@ -1308,13 +1308,13 @@ function workerCodeFn() { if ( s.dyn_ltree[9 * 2] !== - /* .Freq*/ + /* .Freq */ 0 || s.dyn_ltree[10 * 2] !== - /* .Freq*/ + /* .Freq */ 0 || s.dyn_ltree[13 * 2] !== - /* .Freq*/ + /* .Freq */ 0 ) { return Z_TEXT @@ -1323,7 +1323,7 @@ function workerCodeFn() { for (n = 32; n < LITERALS; n++) { if ( s.dyn_ltree[n * 2] !== - /* .Freq*/ + /* .Freq */ 0 ) { return Z_TEXT @@ -1488,7 +1488,7 @@ function workerCodeFn() { if (dist === 0) { /* lc is the unmatched char */ - s.dyn_ltree[lc * 2] /* .Freq*/++ + s.dyn_ltree[lc * 2] /* .Freq */++ } else { s.matches++ /* Here, lc is the match length - MIN_MATCH */ @@ -1499,8 +1499,8 @@ function workerCodeFn() { // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /* .Freq*/++ - s.dyn_dtree[d_code(dist) * 2] /* .Freq*/++ + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /* .Freq */++ + s.dyn_dtree[d_code(dist) * 2] /* .Freq */++ } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility // #ifdef TRUNCATE_BLOCK @@ -1777,9 +1777,9 @@ function workerCodeFn() { var _tr_flush_block$1 = trees._tr_flush_block var _tr_tally$1 = trees._tr_tally var _tr_align$1 = trees._tr_align - /* Public constants ==========================================================*/ + /* Public constants ========================================================== */ - /* ===========================================================================*/ + /* =========================================================================== */ var Z_NO_FLUSH = constants.Z_NO_FLUSH var Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH @@ -1799,7 +1799,7 @@ function workerCodeFn() { var Z_DEFAULT_STRATEGY = constants.Z_DEFAULT_STRATEGY var Z_UNKNOWN$1 = constants.Z_UNKNOWN var Z_DEFLATED = constants.Z_DEFLATED - /* ============================================================================*/ + /* ============================================================================ */ var MAX_MEM_LEVEL = 9 /* Maximum value for memLevel in deflateInit2 */ @@ -1996,7 +1996,7 @@ function workerCodeFn() { /* stop if match long enough */ var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0 - /* NIL*/ + /* NIL */ var _win = s.window // shortcut var wmask = s.w_mask @@ -2061,7 +2061,7 @@ function workerCodeFn() { */ do { - /* jshint noempty:false*/ + /* jshint noempty:false */ } while ( _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && @@ -2307,7 +2307,7 @@ function workerCodeFn() { /* strstart == 0 is possible when wraparound on 16-bit machine */ s.lookahead = s.strstart - max_start s.strstart = max_start - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) @@ -2321,7 +2321,7 @@ function workerCodeFn() { */ if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2334,7 +2334,7 @@ function workerCodeFn() { s.insert = 0 if (flush === Z_FINISH) { - /** * FLUSH_BLOCK(s, 1); ***/ + /** * FLUSH_BLOCK(s, 1); ** */ flush_block_only(s, true) if (s.strm.avail_out === 0) { @@ -2346,7 +2346,7 @@ function workerCodeFn() { } if (s.strstart > s.block_start) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2395,10 +2395,10 @@ function workerCodeFn() { */ hash_head = 0 - /* NIL*/ + /* NIL */ if (s.lookahead >= MIN_MATCH$1) { - /** * INSERT_STRING(s, s.strstart, hash_head); ***/ + /** * INSERT_STRING(s, s.strstart, hash_head); ** */ s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]) hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart @@ -2410,7 +2410,7 @@ function workerCodeFn() { if ( hash_head !== 0 && - /* NIL*/ + /* NIL */ s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD ) { /* To simplify the code, we prevent matches with the string @@ -2425,7 +2425,7 @@ function workerCodeFn() { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /** * _tr_tally_dist(s, s.strstart - s.match_start, - s.match_length - MIN_MATCH, bflush); ***/ + s.match_length - MIN_MATCH, bflush); ** */ bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1) s.lookahead -= s.match_length /* Insert new strings in the hash table only if the match length @@ -2434,7 +2434,7 @@ function workerCodeFn() { if ( s.match_length <= s.max_lazy_match && - /* max_insert_length*/ + /* max_insert_length */ s.lookahead >= MIN_MATCH$1 ) { s.match_length-- @@ -2442,7 +2442,7 @@ function workerCodeFn() { do { s.strstart++ - /** * INSERT_STRING(s, s.strstart, hash_head); ***/ + /** * INSERT_STRING(s, s.strstart, hash_head); ** */ s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]) hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] @@ -2473,14 +2473,14 @@ function workerCodeFn() { /* No match, output a literal byte */ // Tracevv((stderr,"%c", s.window[s.strstart])); - /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ** */ bflush = _tr_tally$1(s, 0, s.window[s.strstart]) s.lookahead-- s.strstart++ } if (bflush) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2493,7 +2493,7 @@ function workerCodeFn() { s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1 if (flush === Z_FINISH) { - /** * FLUSH_BLOCK(s, 1); ***/ + /** * FLUSH_BLOCK(s, 1); ** */ flush_block_only(s, true) if (s.strm.avail_out === 0) { @@ -2505,7 +2505,7 @@ function workerCodeFn() { } if (s.last_lit) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2555,10 +2555,10 @@ function workerCodeFn() { */ hash_head = 0 - /* NIL*/ + /* NIL */ if (s.lookahead >= MIN_MATCH$1) { - /** * INSERT_STRING(s, s.strstart, hash_head); ***/ + /** * INSERT_STRING(s, s.strstart, hash_head); ** */ s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]) hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart @@ -2573,10 +2573,10 @@ function workerCodeFn() { if ( hash_head !== 0 && - /* NIL*/ + /* NIL */ s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD - /* MAX_DIST(s)*/ + /* MAX_DIST(s) */ ) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match @@ -2588,7 +2588,7 @@ function workerCodeFn() { if ( s.match_length <= 5 && (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096)) - /* TOO_FAR*/ + /* TOO_FAR */ ) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. @@ -2606,7 +2606,7 @@ function workerCodeFn() { // check_match(s, s.strstart-1, s.prev_match, s.prev_length); /** *_tr_tally_dist(s, s.strstart - 1 - s.prev_match, - s.prev_length - MIN_MATCH, bflush);***/ + s.prev_length - MIN_MATCH, bflush);** */ bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1) /* Insert in hash table all strings up to the end of the match. @@ -2620,7 +2620,7 @@ function workerCodeFn() { do { if (++s.strstart <= max_insert) { - /** * INSERT_STRING(s, s.strstart, hash_head); ***/ + /** * INSERT_STRING(s, s.strstart, hash_head); ** */ s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]) hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart @@ -2633,7 +2633,7 @@ function workerCodeFn() { s.strstart++ if (bflush) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2648,11 +2648,11 @@ function workerCodeFn() { */ // Tracevv((stderr,"%c", s->window[s->strstart-1])); - /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ** */ bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]) if (bflush) { - /** * FLUSH_BLOCK_ONLY(s, 0) ***/ + /** * FLUSH_BLOCK_ONLY(s, 0) ** */ flush_block_only(s, false) /***/ } @@ -2676,7 +2676,7 @@ function workerCodeFn() { if (s.match_available) { // Tracevv((stderr,"%c", s->window[s->strstart-1])); - /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ** */ bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]) s.match_available = 0 } @@ -2684,7 +2684,7 @@ function workerCodeFn() { s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1 if (flush === Z_FINISH) { - /** * FLUSH_BLOCK(s, 1); ***/ + /** * FLUSH_BLOCK(s, 1); ** */ flush_block_only(s, true) if (s.strm.avail_out === 0) { @@ -2696,7 +2696,7 @@ function workerCodeFn() { } if (s.last_lit) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2755,7 +2755,7 @@ function workerCodeFn() { strend = s.strstart + MAX_MATCH$1 do { - /* jshint noempty:false*/ + /* jshint noempty:false */ } while ( prev === _win[++scan] && prev === _win[++scan] && @@ -2780,7 +2780,7 @@ function workerCodeFn() { if (s.match_length >= MIN_MATCH$1) { // check_match(s, s.strstart, s.strstart - 1, s.match_length); - /** * _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + /** * _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ** */ bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1) s.lookahead -= s.match_length s.strstart += s.match_length @@ -2789,14 +2789,14 @@ function workerCodeFn() { /* No match, output a literal byte */ // Tracevv((stderr,"%c", s->window[s->strstart])); - /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ** */ bflush = _tr_tally$1(s, 0, s.window[s.strstart]) s.lookahead-- s.strstart++ } if (bflush) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2809,7 +2809,7 @@ function workerCodeFn() { s.insert = 0 if (flush === Z_FINISH) { - /** * FLUSH_BLOCK(s, 1); ***/ + /** * FLUSH_BLOCK(s, 1); ** */ flush_block_only(s, true) if (s.strm.avail_out === 0) { @@ -2821,7 +2821,7 @@ function workerCodeFn() { } if (s.last_lit) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2859,14 +2859,14 @@ function workerCodeFn() { s.match_length = 0 // Tracevv((stderr,"%c", s->window[s->strstart])); - /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ** */ bflush = _tr_tally$1(s, 0, s.window[s.strstart]) s.lookahead-- s.strstart++ if (bflush) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2879,7 +2879,7 @@ function workerCodeFn() { s.insert = 0 if (flush === Z_FINISH) { - /** * FLUSH_BLOCK(s, 1); ***/ + /** * FLUSH_BLOCK(s, 1); ** */ flush_block_only(s, true) if (s.strm.avail_out === 0) { @@ -2891,7 +2891,7 @@ function workerCodeFn() { } if (s.last_lit) { - /** * FLUSH_BLOCK(s, 0); ***/ + /** * FLUSH_BLOCK(s, 0); ** */ flush_block_only(s, false) if (s.strm.avail_out === 0) { @@ -2945,7 +2945,7 @@ function workerCodeFn() { var lm_init = function lm_init(s) { s.window_size = 2 * s.w_size - /** * CLEAR_HASH(s); ***/ + /** * CLEAR_HASH(s); ** */ zero$1(s.head) // Fill with NIL (= 0); @@ -3100,7 +3100,7 @@ function workerCodeFn() { /* compression level (1..9) */ this.strategy = 0 - /* favor or force Huffman coding*/ + /* favor or force Huffman coding */ this.good_match = 0 /* Use a faster search when the previous match is longer than this */ @@ -3460,7 +3460,7 @@ function workerCodeFn() { if (s.status === EXTRA_STATE) { if ( s.gzhead.extra - /* != Z_NULL*/ + /* != Z_NULL */ ) { beg = s.pending /* start of bytes to update crc */ @@ -3499,7 +3499,7 @@ function workerCodeFn() { if (s.status === NAME_STATE) { if ( s.gzhead.name - /* != Z_NULL*/ + /* != Z_NULL */ ) { beg = s.pending /* start of bytes to update crc */ @@ -3545,7 +3545,7 @@ function workerCodeFn() { if (s.status === COMMENT_STATE) { if ( s.gzhead.comment - /* != Z_NULL*/ + /* != Z_NULL */ ) { beg = s.pending /* start of bytes to update crc */ @@ -3674,7 +3674,7 @@ function workerCodeFn() { */ if (flush === Z_FULL_FLUSH) { - /** * CLEAR_HASH(s); ***/ + /** * CLEAR_HASH(s); ** */ /* forget history */ zero$1(s.head) // Fill with NIL (= 0); @@ -3738,9 +3738,9 @@ function workerCodeFn() { var deflateEnd = function deflateEnd(strm) { if ( !strm || - /* == Z_NULL*/ + /* == Z_NULL */ !strm.state - /* == Z_NULL*/ + /* == Z_NULL */ ) { return Z_STREAM_ERROR } @@ -3772,9 +3772,9 @@ function workerCodeFn() { if ( !strm || - /* == Z_NULL*/ + /* == Z_NULL */ !strm.state - /* == Z_NULL*/ + /* == Z_NULL */ ) { return Z_STREAM_ERROR } @@ -3801,7 +3801,7 @@ function workerCodeFn() { if (wrap === 0) { /* already empty otherwise */ - /** * CLEAR_HASH(s); ***/ + /** * CLEAR_HASH(s); ** */ zero$1(s.head) // Fill with NIL (= 0); s.strstart = 0 @@ -3910,7 +3910,7 @@ function workerCodeFn() { var assign = function assign( obj - /* from1, from2, from3, ...*/ + /* from1, from2, from3, ... */ ) { var sources = Array.prototype.slice.call(arguments, 1) @@ -4194,14 +4194,14 @@ function workerCodeFn() { /* last error message, NULL if no error */ this.msg = '' - /* Z_NULL*/ + /* Z_NULL */ /* not visible by applications */ this.state = null /* best guess about the data type: binary or text */ this.data_type = 2 - /* Z_UNKNOWN*/ + /* Z_UNKNOWN */ /* adler32 value of the uncompressed data */ this.adler = 0 @@ -4211,9 +4211,9 @@ function workerCodeFn() { // eslint-disable-next-line @typescript-eslint/unbound-method var toString = Object.prototype.toString - /* Public constants ==========================================================*/ + /* Public constants ========================================================== */ - /* ===========================================================================*/ + /* =========================================================================== */ var Z_NO_FLUSH$1 = constants.Z_NO_FLUSH var Z_SYNC_FLUSH = constants.Z_SYNC_FLUSH @@ -4224,7 +4224,7 @@ function workerCodeFn() { var Z_DEFAULT_COMPRESSION$1 = constants.Z_DEFAULT_COMPRESSION var Z_DEFAULT_STRATEGY$1 = constants.Z_DEFAULT_STRATEGY var Z_DEFLATED$1 = constants.Z_DEFLATED - /* ===========================================================================*/ + /* =========================================================================== */ /** * class Deflate @@ -4232,13 +4232,13 @@ function workerCodeFn() { * Generic JS-style wrapper for zlib calls. If you don't need * streaming behaviour - use more simple functions: [[deflate]], * [[deflateRaw]] and [[gzip]]. - **/ + * */ /* internal * Deflate.chunks -> Array * * Chunks of output data, if [[Deflate#onData]] not overridden. - **/ + * */ /** * Deflate.result -> Uint8Array @@ -4246,7 +4246,7 @@ function workerCodeFn() { * Compressed result, generated by default [[Deflate#onData]] * and [[Deflate#onEnd]] handlers. Filled after you push last chunk * (call [[Deflate#push]] with `Z_FINISH` / `true` param). - **/ + * */ /** * Deflate.err -> Number @@ -4255,13 +4255,13 @@ function workerCodeFn() { * You will not need it in real life, because deflate errors * are possible only on wrong options or bad `onData` / `onEnd` * custom handlers. - **/ + * */ /** * Deflate.msg -> String * * Error message, if [[Deflate.err]] != 0 - **/ + * */ /** * new Deflate(options) @@ -4309,7 +4309,7 @@ function workerCodeFn() { * * console.log(deflate.result); * ``` - **/ + * */ function Deflate(options) { this.options = common.assign( @@ -4393,7 +4393,7 @@ function workerCodeFn() { * ... * push(chunk, true); // push last chunk * ``` - **/ + * */ Deflate.prototype.push = function (data, flush_mode) { var strm = this.strm @@ -4474,7 +4474,7 @@ function workerCodeFn() { * * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. - **/ + * */ Deflate.prototype.onData = function (chunk) { this.chunks.push(chunk) @@ -4487,7 +4487,7 @@ function workerCodeFn() { * Called once after you tell deflate that the input stream is * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. - **/ + * */ Deflate.prototype.onEnd = function (status) { // On success - join @@ -4530,7 +4530,7 @@ function workerCodeFn() { * * console.log(pako.deflate(data)); * ``` - **/ + * */ function deflate$1(input, options) { var deflator = new Deflate(options) @@ -4549,7 +4549,7 @@ function workerCodeFn() { * * The same as [[deflate]], but creates raw data, without wrapper * (header and adler32 crc). - **/ + * */ // eslint-disable-next-line @typescript-eslint/no-unused-vars function deflateRaw(input, options) { @@ -4564,7 +4564,7 @@ function workerCodeFn() { * * The same as [[deflate]], but create gzip wrapper instead of * deflate one. - **/ + * */ // eslint-disable-next-line @typescript-eslint/no-unused-vars function gzip(input, options) { options = options || {} From 04d1cb975a2979b56002f6dddb71175d0b0c4f62 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 25 Jan 2021 11:34:57 +0100 Subject: [PATCH 65/69] =?UTF-8?q?=F0=9F=91=8C=20Disable=20all=20rules=20fo?= =?UTF-8?q?r=20deflateWorker.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/rum-recorder/src/domain/deflateWorker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rum-recorder/src/domain/deflateWorker.js b/packages/rum-recorder/src/domain/deflateWorker.js index ac8285d7eb..047992bff5 100644 --- a/packages/rum-recorder/src/domain/deflateWorker.js +++ b/packages/rum-recorder/src/domain/deflateWorker.js @@ -1,4 +1,4 @@ -/* eslint-disable no-bitwise,max-len,no-underscore-dangle,jsdoc/check-indentation */ +/* eslint-disable */ let workerURL export function createDeflateWorker() { From 60d934d21d6df9e1172c82affa41150a1d030508 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 25 Jan 2021 11:53:33 +0100 Subject: [PATCH 66/69] =?UTF-8?q?=F0=9F=91=8C=20Remove=20uneeded=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/app/app.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/app/app.ts b/test/app/app.ts index 993d55bd44..054096c853 100644 --- a/test/app/app.ts +++ b/test/app/app.ts @@ -8,9 +8,6 @@ declare global { } } -// ESLint cannot infer typing for datadogLogs and datadogRum -/* eslint-disable @typescript-eslint/no-unsafe-call */ - if (typeof window !== 'undefined') { if (window.LOGS_CONFIG) { datadogLogs.init(window.LOGS_CONFIG) From 7b9c6d8d9031f65e5a9b1191f618be3fda611723 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 25 Jan 2021 12:14:07 +0100 Subject: [PATCH 67/69] Fix lint on CI --- .gitlab-ci.yml | 12 ++---------- rum-events-format | 2 +- yarn.lock | 12 ++++++------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc7c54e9d8..b394447aeb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,14 +30,6 @@ format: - yarn - yarn format -lint: - stage: test - tags: ['runner:main', 'size:large'] - image: $CI_IMAGE - script: - - yarn - - yarn lint - typecheck: stage: test tags: ['runner:main', 'size:large'] @@ -46,14 +38,14 @@ typecheck: - yarn - yarn typecheck -build: +build-and-lint: stage: test tags: ['runner:main', 'size:large'] image: $CI_IMAGE script: - yarn - yarn build - - scripts/cli lint test/app + - yarn lint - scripts/cli typecheck test/app build-bundle: diff --git a/rum-events-format b/rum-events-format index e15afe458d..8b955a03d0 160000 --- a/rum-events-format +++ b/rum-events-format @@ -1 +1 @@ -Subproject commit e15afe458daee62dc7fae3fc061c48097bb8612a +Subproject commit 8b955a03d0fe0b2f032a02d6800c61ef3fc9fada diff --git a/yarn.lock b/yarn.lock index ad7ce1404b..4f24e1d1be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4839,10 +4839,10 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" -flatted@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" - integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== +flatted@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== flatted@^3.1.0: version "3.1.0" @@ -5136,7 +5136,7 @@ glob-parent@^5.0.0: dependencies: is-glob "^4.0.1" -glob-parent@^5.1.0: +glob-parent@^5.1.0, glob-parent@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== @@ -9367,7 +9367,7 @@ socket.io-parser@~3.4.0: debug "~4.1.0" isarray "2.0.1" -socket.io@2.4.1, socket.io@^2.3.0: +socket.io@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.4.1.tgz#95ad861c9a52369d7f1a68acf0d4a1b16da451d2" integrity sha512-Si18v0mMXGAqLqCVpTxBa8MGqriHGQh8ccEOhmsmNS3thNCGBwO8WGrwMibANsWtQQ5NStdZwHqZR3naJVFc3w== From 11020ea063599ba14b0726f5c57a02c42eda7d07 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 26 Jan 2021 10:16:16 +0100 Subject: [PATCH 68/69] =?UTF-8?q?=F0=9F=91=8C=20Improve=20tests=20readabil?= =?UTF-8?q?ity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/browser/fetchProxy.spec.ts | 2 +- test/e2e/scenario/rum/tracing.scenario.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/core/src/browser/fetchProxy.spec.ts b/packages/core/src/browser/fetchProxy.spec.ts index d60996e7d3..34757419e8 100644 --- a/packages/core/src/browser/fetchProxy.spec.ts +++ b/packages/core/src/browser/fetchProxy.spec.ts @@ -128,7 +128,7 @@ describe('fetch proxy', () => { const fetchStubPromise = fetchStub(FAKE_URL) const spy = jasmine.createSpy() fetchStubPromise.then(spy).catch(() => { - expect(false).toBe(true, 'Should not have thrown an error!') + fail('Should not have thrown an error!') }) fetchStubPromise.resolveWith({ status: 500 }) diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index 7412b201f7..d4cdf63461 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -1,3 +1,4 @@ +import { raw } from 'express' import { createTest, EventRegistry } from '../../lib/framework' import { browserExecuteAsync, sendXhr } from '../../lib/helpers/browser' import { flushEvents } from '../../lib/helpers/sdk' @@ -18,7 +19,7 @@ describe('tracing', () => { createTest('trace fetch') .withRum({ service: 'Service', allowedTracingOrigins: ['LOCATION_ORIGIN'] }) .run(async ({ events }) => { - const rawHeaders = await browserExecuteAsync((done) => { + const rawHeaders = await browserExecuteAsync((done) => { window .fetch('/headers', { headers: [ @@ -28,8 +29,11 @@ describe('tracing', () => { }) .then((response) => response.text()) .then(done) - .catch(() => done('{}')) + .catch(() => done(new Error('Fetch request failed!'))) }) + if (rawHeaders instanceof Error) { + return fail(rawHeaders) + } checkRequestHeaders(rawHeaders) await flushEvents() checkTraceAssociatedToRumEvent(events) @@ -38,13 +42,16 @@ describe('tracing', () => { createTest('trace fetch with Request argument') .withRum({ service: 'Service', allowedTracingOrigins: ['LOCATION_ORIGIN'] }) .run(async ({ events }) => { - const rawHeaders = await browserExecuteAsync((done) => { + const rawHeaders = await browserExecuteAsync((done) => { window .fetch(new Request('/headers', { headers: { 'x-foo': 'bar, baz' } })) .then((response) => response.text()) .then(done) - .catch(() => done('{}')) + .catch(() => done(new Error('Fetch request failed!'))) }) + if (rawHeaders instanceof Error) { + return fail(rawHeaders) + } checkRequestHeaders(rawHeaders) await flushEvents() checkTraceAssociatedToRumEvent(events) From b63aa1f2ffc4f23f506d86ebe99adc51ed9c4da4 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 26 Jan 2021 10:20:16 +0100 Subject: [PATCH 69/69] Remove unused import --- test/e2e/scenario/rum/tracing.scenario.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index d4cdf63461..88af3a7735 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -1,4 +1,3 @@ -import { raw } from 'express' import { createTest, EventRegistry } from '../../lib/framework' import { browserExecuteAsync, sendXhr } from '../../lib/helpers/browser' import { flushEvents } from '../../lib/helpers/sdk'