From b2e9a060b451da65864f14d7bf33a6804aeba18d Mon Sep 17 00:00:00 2001 From: Jake Fried Date: Tue, 11 Jan 2022 19:15:17 -0500 Subject: [PATCH] lint: support typescript (#37324) * lint: support typescript * low hanging fruit * Lint for rule-of-hooks * for ts files, don't need all the jsdoc rules * more low hanging fruit * fix import assertions * unused incorrect ordering * rcebulko finds. * remove sort-requires * Fix newly found BS errors from TS Upgrade. * jridgewell feedback --- .eslintrc.js | 20 +- ads/vendors/csa.js | 2 +- .../common/update-session-issues/index.js | 4 +- build-system/global.d.ts | 2 +- build-system/release-tagger/make-release.js | 2 +- build-system/release-tagger/utils.js | 2 +- build-system/server/app.js | 2 +- .../transforms/cdn/cdn-transform.ts | 17 +- .../transforms/css/css-transform.ts | 5 +- .../transforms/modules/modules-transform.ts | 38 +- .../transforms/sxg/sxg-transform.ts | 17 +- .../server/new-server/transforms/transform.ts | 13 +- .../transforms/utilities/cdn-tag.ts | 23 +- .../new-server/transforms/utilities/cdn.ts | 12 +- .../transforms/utilities/option-set.ts | 4 +- .../tasks/check-analytics-vendors-list.js | 5 +- build-system/tasks/helpers.js | 2 +- .../tasks/performance/analytics-handler.js | 2 +- build-system/tasks/performance/index.js | 2 +- build-system/tasks/sweep-experiments/index.js | 2 +- build-system/tasks/visual-diff/dev-mode.js | 2 +- build-system/tasks/visual-diff/index.js | 2 +- build-system/tasks/visual-diff/log.js | 2 +- build-system/tasks/visual-diff/types.js | 2 +- build-system/tasks/visual-diff/verifiers.js | 2 +- build-system/test-configs/config.js | 2 + build-system/test-configs/forbidden-terms.js | 3 +- examples/ac-creative.js | 2 + examples/pwa/pwa-sw.js | 2 +- examples/pwa/pwa.js | 8 +- .../0.1/iframe-api/access-controller.js | 8 +- .../test/test-amp-ad-network-adsense-impl.js | 2 +- .../0.1/amp-ad-network-doubleclick-impl.js | 2 +- .../0.1/test/test-amp-ad-network-fake-impl.js | 2 +- .../test/test-amp-ad-network-oblivki-impl.js | 4 +- .../test/test-amp-ad-network-smartads-impl.js | 4 +- extensions/amp-ad/0.1/amp-ad-3p-impl.js | 4 +- .../0.1/runners/animation-runner.js | 2 +- .../amp-autocomplete/0.1/amp-autocomplete.js | 2 +- .../0.1/tcf-api-command-manager.js | 2 +- .../0.1/amp-fx-collection.js | 2 +- .../0.1/providers/fx-provider.js | 4 +- .../0.1/amp-intersection-observer-polyfill.js | 3 +- .../amp-lightbox-gallery/1.0/consumer.js | 2 +- .../amp-next-page/1.0/visibility-observer.js | 2 +- .../0.1/amp-resize-observer-polyfill.js | 2 +- .../1.0/amp-story-localization-service.js | 2 +- .../0.1/messaging/messaging.js | 2 +- .../amp-viqeo-player/0.1/amp-viqeo-player.js | 2 +- package-lock.json | 694 +++++++++++++----- package.json | 7 +- src/compiler/types.d.ts | 2 +- src/consent.js | 5 +- src/core/mode/globals.d.ts | 1 + src/purifier/index.d.ts | 2 - src/runtime.js | 3 +- src/service/localization/index.js | 2 +- src/service/mutator-interface.js | 2 +- src/service/owners-interface.js | 2 +- .../position-observer-impl.js | 2 +- src/service/resources-interface.js | 2 +- src/service/viewer-interface.js | 2 +- src/service/viewport/viewport-interface.js | 2 +- src/utils/log.d.ts | 8 + test/unit/test-vsync.js | 16 +- testing/amp-performance-extension/measure.js | 4 +- third_party/subscriptions-project/swg.js | 2 +- 67 files changed, 699 insertions(+), 315 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 97d6e92e474d..f3d81dec23c1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,7 +28,7 @@ function getExperimentGlobals() { module.exports = { 'root': true, - 'parser': '@babel/eslint-parser', + 'parser': '@typescript-eslint/parser', 'plugins': [ 'chai-expect', 'import', @@ -39,14 +39,13 @@ module.exports = { 'react', 'react-hooks', 'sort-destructure-keys', - 'sort-requires', + '@typescript-eslint', ], 'env': { 'es6': true, 'browser': true, }, 'parserOptions': { - 'ecmaVersion': 6, 'jsx': true, 'sourceType': 'module', }, @@ -260,7 +259,8 @@ module.exports = { 'no-sequences': 2, 'no-throw-literal': 2, 'no-unused-expressions': 0, - 'no-unused-vars': [ + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ 2, { 'argsIgnorePattern': '^(var_args$|opt_|unused)', @@ -341,9 +341,17 @@ module.exports = { 'ignoreDeclarationSort': true, }, ], - 'sort-requires/sort-requires': 2, }, 'overrides': [ + { + 'files': ['**/*.ts'], + 'rules': { + 'require-jsdoc': 0, + 'jsdoc/require-param': 0, + 'jsdoc/require-param-type': 0, + 'jsdoc/require-returns': 0, + }, + }, { 'files': [ 'test/**/*.js', @@ -432,7 +440,7 @@ module.exports = { 'rules': { 'no-var': 0, 'no-undef': 0, - 'no-unused-vars': 0, + '@typescript-eslint/no-unused-vars': 0, 'prefer-const': 0, 'require-jsdoc': 0, 'jsdoc/check-tag-names': 0, diff --git a/ads/vendors/csa.js b/ads/vendors/csa.js index a4d2a9301ff5..710ef5e883bd 100644 --- a/ads/vendors/csa.js +++ b/ads/vendors/csa.js @@ -104,7 +104,7 @@ function orientationChangeHandler(global, containerDiv) { const oldHeight = getStyle(containerDiv, 'height'); global.setTimeout(() => { // Force DOM reflow and repaint. - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars const ignore = global.document.body./*OK*/ offsetHeight; // Capture new height. const newHeight = getStyle(containerDiv, 'height'); diff --git a/build-system/common/update-session-issues/index.js b/build-system/common/update-session-issues/index.js index dc8c7815db42..baf8235a4597 100644 --- a/build-system/common/update-session-issues/index.js +++ b/build-system/common/update-session-issues/index.js @@ -15,8 +15,8 @@ * ⚠️ Only use standard node modules. * This file cannot depend on `npm install`. */ -const https = require('https'); const {readdir} = require('fs').promises; +const https = require('https'); const {relative} = require('path'); const {RotationItemDef, TemplateDef} = require('./types'); @@ -399,7 +399,7 @@ function getSessionDateFromTitle(title) { } const [ // @ts-ignore - unusedFullMatch, // eslint-disable-line no-unused-vars + unusedFullMatch, // eslint-disable-line @typescript-eslint/no-unused-vars day, time, ] = match; diff --git a/build-system/global.d.ts b/build-system/global.d.ts index 7a430e9e86d3..4f5a9ec5c5b3 100644 --- a/build-system/global.d.ts +++ b/build-system/global.d.ts @@ -56,4 +56,4 @@ declare global { } } -export { } +export {}; diff --git a/build-system/release-tagger/make-release.js b/build-system/release-tagger/make-release.js index e5bea5a869cc..c575c90fe82d 100644 --- a/build-system/release-tagger/make-release.js +++ b/build-system/release-tagger/make-release.js @@ -11,7 +11,7 @@ const { getRef, } = require('./utils'); const {getExtensions, getSemver} = require('../npm-publish/utils'); -const {GraphQlQueryResponseData} = require('@octokit/graphql'); //eslint-disable-line no-unused-vars +const {GraphQlQueryResponseData} = require('@octokit/graphql'); // eslint-disable-line @typescript-eslint/no-unused-vars const prereleaseConfig = { 'beta-opt-in': true, diff --git a/build-system/release-tagger/utils.js b/build-system/release-tagger/utils.js index 681e0d3f18c0..29662039c99f 100644 --- a/build-system/release-tagger/utils.js +++ b/build-system/release-tagger/utils.js @@ -4,7 +4,7 @@ */ const dedent = require('dedent'); -const {GraphQlQueryResponseData, graphql} = require('@octokit/graphql'); //eslint-disable-line no-unused-vars +const {GraphQlQueryResponseData, graphql} = require('@octokit/graphql'); // eslint-disable-line @typescript-eslint/no-unused-vars const {Octokit} = require('@octokit/rest'); // setup diff --git a/build-system/server/app.js b/build-system/server/app.js index 3db920986f59..671217091693 100644 --- a/build-system/server/app.js +++ b/build-system/server/app.js @@ -650,7 +650,7 @@ function liveListInsert(liveList, node) { */ const child = /** @type {*} */ (node.cloneNode(true)); child.setAttribute('id', `list-item-${itemCtr++}`); - child.setAttribute('data-sort-time', Date.now()); + child.setAttribute('data-sort-time', Date.now().toString()); liveList.querySelector('[items]')?.appendChild(child); } } diff --git a/build-system/server/new-server/transforms/cdn/cdn-transform.ts b/build-system/server/new-server/transforms/cdn/cdn-transform.ts index 315512c3114c..9fa7853c8016 100644 --- a/build-system/server/new-server/transforms/cdn/cdn-transform.ts +++ b/build-system/server/new-server/transforms/cdn/cdn-transform.ts @@ -1,5 +1,3 @@ - - import posthtml from 'posthtml'; import { getCdnUrlAttr, @@ -11,7 +9,10 @@ import {CDNURLToLocalHostRelativeAbsoluteDist} from '../utilities/cdn'; import {OptionSet} from '../utilities/option-set'; import {parse} from 'path'; -function maybeModifyCdnUrl(node: posthtml.Node, options: OptionSet): posthtml.Node { +function maybeModifyCdnUrl( + node: posthtml.Node, + options: OptionSet +): posthtml.Node { // Make sure to call `isJsonScript` before `tryGetUrl`. We bail out early if // the node is of type="application/json" since it wouldn't have a URL. if (isJsonScript(node)) { @@ -50,11 +51,9 @@ export default function ( options: OptionSet = {} ): (tree: posthtml.Node) => void { return function (tree: posthtml.Node) { - tree.match([ - {tag: 'script'}, - {tag: 'link', attrs: {rel: 'stylesheet'}}, - ], (node) => { - return maybeModifyCdnUrl(node, options); - }); + tree.match( + [{tag: 'script'}, {tag: 'link', attrs: {rel: 'stylesheet'}}], + (node) => maybeModifyCdnUrl(node, options) + ); }; } diff --git a/build-system/server/new-server/transforms/css/css-transform.ts b/build-system/server/new-server/transforms/css/css-transform.ts index 18ed06e01cbb..a472d3d11708 100644 --- a/build-system/server/new-server/transforms/css/css-transform.ts +++ b/build-system/server/new-server/transforms/css/css-transform.ts @@ -1,7 +1,6 @@ import minimist from 'minimist'; import posthtml from 'posthtml'; import {readFileSync} from 'fs'; -import {OptionSet} from '../utilities/option-set'; import {Lazy} from '../utilities/lazy'; const argv = minimist(process.argv.slice(2)); @@ -66,9 +65,7 @@ function prependAmpStyles(head: posthtml.Node): posthtml.Node { /** * Replace the src for every stories script tag. */ -export default function ( - _options: OptionSet = {} -): (tree: posthtml.Node) => void { +export default function (): (tree: posthtml.Node) => void { return function (tree: posthtml.Node) { let isAmp = false; tree.match({tag: 'html'}, function (html: posthtml.Node): posthtml.Node { diff --git a/build-system/server/new-server/transforms/modules/modules-transform.ts b/build-system/server/new-server/transforms/modules/modules-transform.ts index 1db4471e63ee..a4ac212ff989 100644 --- a/build-system/server/new-server/transforms/modules/modules-transform.ts +++ b/build-system/server/new-server/transforms/modules/modules-transform.ts @@ -1,16 +1,23 @@ - - import posthtml from 'posthtml'; -import {isJsonScript, isValidScript, toExtension, ScriptNode, tryGetUrl} from '../utilities/cdn-tag'; +import { + ScriptNode, + isJsonScript, + isValidScript, + toExtension, + tryGetUrl, +} from '../utilities/cdn-tag'; import {OptionSet} from '../utilities/option-set'; -/** - * @param head - * @param script - */ -function appendModuleScript(head: posthtml.Node, nomoduleScript: ScriptNode, options: OptionSet): void { - const modulePath = toExtension(tryGetUrl(nomoduleScript.attrs.src), '.mjs').toString(); - const moduleScript : ScriptNode = { +function appendModuleScript( + head: posthtml.Node, + nomoduleScript: ScriptNode, + options: OptionSet +): void { + const modulePath = toExtension( + tryGetUrl(nomoduleScript.attrs.src), + '.mjs' + ).toString(); + const moduleScript: ScriptNode = { ...nomoduleScript, attrs: { ...nomoduleScript.attrs, @@ -37,11 +44,13 @@ function appendModuleScript(head: posthtml.Node, nomoduleScript: ScriptNode, opt * Returns a function that will transform script node sources into module/nomodule pair. * @param options */ -export default function(options: OptionSet = {}): (tree: posthtml.Node) => void { - return function(tree: posthtml.Node): void { +export default function ( + options: OptionSet = {} +): (tree: posthtml.Node) => void { + return function (tree: posthtml.Node): void { let head: posthtml.Node | undefined = undefined; const scripts: Array = []; - tree.walk(node => { + tree.walk((node) => { if (node.tag === 'head') { head = node; } @@ -64,6 +73,7 @@ export default function(options: OptionSet = {}): (tree: posthtml.Node) => void }); if (head === undefined) { + // eslint-disable-next-line local/no-forbidden-terms console.log('Could not find a head element in the document'); return; } @@ -71,5 +81,5 @@ export default function(options: OptionSet = {}): (tree: posthtml.Node) => void for (const script of scripts) { appendModuleScript(head, script, options); } - } + }; } diff --git a/build-system/server/new-server/transforms/sxg/sxg-transform.ts b/build-system/server/new-server/transforms/sxg/sxg-transform.ts index 75be878a2dff..c99c92df4104 100644 --- a/build-system/server/new-server/transforms/sxg/sxg-transform.ts +++ b/build-system/server/new-server/transforms/sxg/sxg-transform.ts @@ -1,11 +1,12 @@ - - import posthtml from 'posthtml'; import {URL} from 'url'; import {isJsonScript, isValidScript} from '../utilities/cdn-tag'; import {OptionSet} from '../utilities/option-set'; -function sxgTransform(node: posthtml.Node, options: OptionSet = {}): posthtml.Node { +function sxgTransform( + node: posthtml.Node, + options: OptionSet = {} +): posthtml.Node { // Make sure that isJsonScript is used before `isValidScript`. We bail out // early if the ScriptNode is of type="application/json" since it wouldn't // have any src url to modify. @@ -18,7 +19,7 @@ function sxgTransform(node: posthtml.Node, options: OptionSet = {}): posthtml.No } if (options.minified) { - const src = node.attrs.src; + const {src} = node.attrs; node.attrs.src = src.replace('.js', '.sxg.js'); } else { const url = new URL(node.attrs.src); @@ -33,10 +34,12 @@ function sxgTransform(node: posthtml.Node, options: OptionSet = {}): posthtml.No * Returns a function that will transform script node sources into their sxg counterparts. * @param options */ -export default function(options: OptionSet = {}): (tree: posthtml.Node) => void { - return function(tree: posthtml.Node) { +export default function ( + options: OptionSet = {} +): (tree: posthtml.Node) => void { + return function (tree: posthtml.Node) { tree.match({tag: 'script'}, (script) => { return sxgTransform(script, options); }); - } + }; } diff --git a/build-system/server/new-server/transforms/transform.ts b/build-system/server/new-server/transforms/transform.ts index 360ab893508e..1ec2168843b6 100644 --- a/build-system/server/new-server/transforms/transform.ts +++ b/build-system/server/new-server/transforms/transform.ts @@ -1,5 +1,3 @@ - - import fs from 'fs'; import minimist from 'minimist'; import posthtml from 'posthtml'; @@ -10,7 +8,7 @@ import transformCss from './css/css-transform'; const argv = minimist(process.argv.slice(2)); const FOR_TESTING = argv._.includes('integration'); // Use 9876 if running integration tests as this is the KARMA_SERVER_PORT -const PORT = FOR_TESTING ? 9876 : (argv.port ?? 8000); +const PORT = FOR_TESTING ? 9876 : argv.port ?? 8000; const ESM = !!argv.esm; const defaultTransformConfig = { @@ -20,15 +18,10 @@ const defaultTransformConfig = { useMaxNames: !argv.minified, }; -const transforms = [ - transformCdnSrcs(defaultTransformConfig), -]; +const transforms = [transformCdnSrcs(defaultTransformConfig)]; if (ESM) { - transforms.unshift( - transformCss(), - transformModules(defaultTransformConfig), - ); + transforms.unshift(transformCss(), transformModules(defaultTransformConfig)); } export async function transform(fileLocation: string): Promise { diff --git a/build-system/server/new-server/transforms/utilities/cdn-tag.ts b/build-system/server/new-server/transforms/utilities/cdn-tag.ts index 11224203624f..301b481cc7ce 100644 --- a/build-system/server/new-server/transforms/utilities/cdn-tag.ts +++ b/build-system/server/new-server/transforms/utilities/cdn-tag.ts @@ -1,10 +1,7 @@ - - import posthtml from 'posthtml'; import {URL} from 'url'; -import {extname} from 'path'; +import {extname, format, parse} from 'path'; import {VALID_CDN_ORIGIN} from './cdn'; -import {parse, format} from 'path'; export interface ScriptNode extends posthtml.Node { tag: 'script'; @@ -20,7 +17,10 @@ function isValidScriptExtension(url: URL): boolean { return VALID_SCRIPT_EXTENSIONS.includes(extname(url.pathname)); } -export function isValidOrigin(url: URL, looseOriginUrlCheck?: boolean): boolean { +export function isValidOrigin( + url: URL, + looseOriginUrlCheck?: boolean +): boolean { return looseOriginUrlCheck || url.origin === VALID_CDN_ORIGIN; } @@ -29,7 +29,7 @@ export function getCdnUrlAttr(node: posthtml.Node): string | null { return 'src'; } if (node.tag === 'link') { - return 'href' + return 'href'; } return null; } @@ -38,7 +38,10 @@ export function getCdnUrlAttr(node: posthtml.Node): string | null { * Determines if a Node is really a ScriptNode. * @param node */ -export function isValidScript(node: posthtml.Node, looseOriginUrlCheck?: boolean): node is ScriptNode { +export function isValidScript( + node: posthtml.Node, + looseOriginUrlCheck?: boolean +): node is ScriptNode { if (node.tag !== 'script') { return false; } @@ -73,6 +76,10 @@ export function toExtension(url: URL, extension: string): URL { * This is a temporary measure to allow for a relaxed parsing of our * fixture files' src urls before they are all fixed accordingly. */ -export function tryGetUrl(src: string, host: string = '0.0.0.0', port: number = 8000): URL { +export function tryGetUrl( + src: string, + host: string = '0.0.0.0', + port: number = 8000 +): URL { return new URL(src, `http://${host}:${port}`); } diff --git a/build-system/server/new-server/transforms/utilities/cdn.ts b/build-system/server/new-server/transforms/utilities/cdn.ts index 60a20a94eb29..8f3aa45a1355 100644 --- a/build-system/server/new-server/transforms/utilities/cdn.ts +++ b/build-system/server/new-server/transforms/utilities/cdn.ts @@ -1,8 +1,7 @@ - - import {URL} from 'url'; -import {parse, format, basename} from 'path'; +import {basename, format, parse} from 'path'; +// eslint-disable-next-line local/no-forbidden-terms export const VALID_CDN_ORIGIN = 'https://cdn.ampproject.org'; export const AMP_MAIN_BINARIES_RENAMES = new Map([ @@ -19,7 +18,8 @@ export const AMP_MAIN_BINARIES_RENAMES = new Map([ ]); /** - * @param minifiedBasename should be without extension + * @param {string} minifiedBasename should be without extension + * @return {string} */ function getMinifiedName(minifiedBasename: string): string { const renamedBasename = AMP_MAIN_BINARIES_RENAMES.get(minifiedBasename); @@ -90,6 +90,10 @@ export function CDNURLToLocalHostRelativeAbsoluteDist( /** * Convert an existing URL to one from a specific RTV. + * @param url + * @param mode + * @param pathnames + * @param extension */ export function CDNURLToRTVURL( url: URL, diff --git a/build-system/server/new-server/transforms/utilities/option-set.ts b/build-system/server/new-server/transforms/utilities/option-set.ts index c30fc4dd08db..d866d40cf1cc 100644 --- a/build-system/server/new-server/transforms/utilities/option-set.ts +++ b/build-system/server/new-server/transforms/utilities/option-set.ts @@ -1,6 +1,4 @@ - - - /** +/** * A list of options to correspond with options.json for testing purposes. * To add an option, add the corresponding key-value pair into the * options.json, then add the field to this interface. diff --git a/build-system/tasks/check-analytics-vendors-list.js b/build-system/tasks/check-analytics-vendors-list.js index 3b7484d57e5a..15a06b35a5c5 100644 --- a/build-system/tasks/check-analytics-vendors-list.js +++ b/build-system/tasks/check-analytics-vendors-list.js @@ -71,7 +71,10 @@ async function checkAnalyticsVendorsList() { const name = nameMatch .split(/[,\s]+/) .shift() - .replace(/[`"']/g, ''); + ?.replace(/[`"']/g, ''); + if (!name) { + throw new Error(`Could not locate vendor name in: "${nameMatch}"`); + } if (!vendors.includes(name)) { tentative = tentative.replace(fullMatch, ''); } diff --git a/build-system/tasks/helpers.js b/build-system/tasks/helpers.js index c0bb7235d7b2..1be3c5a32048 100644 --- a/build-system/tasks/helpers.js +++ b/build-system/tasks/helpers.js @@ -729,7 +729,7 @@ function massageSourcemaps(sourcemaps, babelMaps, options) { ); remapped.sources = remapped.sources.map((source) => { - if (source.startsWith('/__SOURCE__/')) { + if (source?.startsWith('/__SOURCE__/')) { return source.slice('/__SOURCE__/'.length); } return source; diff --git a/build-system/tasks/performance/analytics-handler.js b/build-system/tasks/performance/analytics-handler.js index 479b31ac7aa1..f3c26eed62bc 100644 --- a/build-system/tasks/performance/analytics-handler.js +++ b/build-system/tasks/performance/analytics-handler.js @@ -1,4 +1,4 @@ -const puppeteer = require('puppeteer'); // eslint-disable-line no-unused-vars +const puppeteer = require('puppeteer'); // eslint-disable-line @typescript-eslint/no-unused-vars /** * diff --git a/build-system/tasks/performance/index.js b/build-system/tasks/performance/index.js index c0af2d1d4b9f..4a2516f9f8d4 100644 --- a/build-system/tasks/performance/index.js +++ b/build-system/tasks/performance/index.js @@ -13,7 +13,7 @@ const {printReport} = require('./print-report'); * @return {!Promise} */ async function performance() { - let resolver = (..._) => {}; // eslint-disable-line no-unused-vars + let resolver = (..._) => {}; // eslint-disable-line @typescript-eslint/no-unused-vars const deferred = new Promise((resolverIn) => { resolver = resolverIn; }); diff --git a/build-system/tasks/sweep-experiments/index.js b/build-system/tasks/sweep-experiments/index.js index a9640c3e601f..7d86bd2386ad 100644 --- a/build-system/tasks/sweep-experiments/index.js +++ b/build-system/tasks/sweep-experiments/index.js @@ -97,7 +97,7 @@ function removeFromExperimentsConfig(id, removedFromConfig) { const reportLine = getJscodeshiftReport(line); if (reportLine) { const [ - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars _, report, ] = reportLine; diff --git a/build-system/tasks/visual-diff/dev-mode.js b/build-system/tasks/visual-diff/dev-mode.js index 3a5abce84d4f..8959ba65fc06 100644 --- a/build-system/tasks/visual-diff/dev-mode.js +++ b/build-system/tasks/visual-diff/dev-mode.js @@ -2,7 +2,7 @@ const inquirer = require('inquirer'); const path = require('path'); -const puppeteer = require('puppeteer'); // eslint-disable-line no-unused-vars +const puppeteer = require('puppeteer'); // eslint-disable-line @typescript-eslint/no-unused-vars const { verifySelectorsInvisible, verifySelectorsVisible, diff --git a/build-system/tasks/visual-diff/index.js b/build-system/tasks/visual-diff/index.js index 850ab71afd00..5b6eb760428c 100644 --- a/build-system/tasks/visual-diff/index.js +++ b/build-system/tasks/visual-diff/index.js @@ -8,7 +8,7 @@ const os = require('os'); const path = require('path'); const Percy = require('@percy/core'); const percySnapshot = require('@percy/puppeteer'); -const puppeteer = require('puppeteer'); // eslint-disable-line no-unused-vars +const puppeteer = require('puppeteer'); // eslint-disable-line @typescript-eslint/no-unused-vars const { createCtrlcHandler, exitCtrlcHandler, diff --git a/build-system/tasks/visual-diff/log.js b/build-system/tasks/visual-diff/log.js index 0f842fe53a1b..b554fc164490 100644 --- a/build-system/tasks/visual-diff/log.js +++ b/build-system/tasks/visual-diff/log.js @@ -1,7 +1,7 @@ 'use strict'; const argv = require('minimist')(process.argv.slice(2)); -const puppeteer = require('puppeteer'); // eslint-disable-line no-unused-vars +const puppeteer = require('puppeteer'); // eslint-disable-line @typescript-eslint/no-unused-vars const {green, red, yellow} = require('kleur/colors'); const {log: logBase} = require('../../common/logging'); diff --git a/build-system/tasks/visual-diff/types.js b/build-system/tasks/visual-diff/types.js index 66fcf777d1aa..97dd1a624ec1 100644 --- a/build-system/tasks/visual-diff/types.js +++ b/build-system/tasks/visual-diff/types.js @@ -1,4 +1,4 @@ -const {ConsoleMessage} = require('puppeteer'); // eslint-disable-line no-unused-vars +const {ConsoleMessage} = require('puppeteer'); // eslint-disable-line @typescript-eslint/no-unused-vars /** * @typedef {{ diff --git a/build-system/tasks/visual-diff/verifiers.js b/build-system/tasks/visual-diff/verifiers.js index edf5d43595fa..879b818ae0a9 100644 --- a/build-system/tasks/visual-diff/verifiers.js +++ b/build-system/tasks/visual-diff/verifiers.js @@ -1,6 +1,6 @@ 'use strict'; -const puppeteer = require('puppeteer'); // eslint-disable-line no-unused-vars +const puppeteer = require('puppeteer'); // eslint-disable-line @typescript-eslint/no-unused-vars const {cyan} = require('kleur/colors'); const {log} = require('./log'); const {sleep} = require('./helpers'); diff --git a/build-system/test-configs/config.js b/build-system/test-configs/config.js index b5db8b7edd30..82aa64455971 100644 --- a/build-system/test-configs/config.js +++ b/build-system/test-configs/config.js @@ -109,6 +109,8 @@ const jisonPath = 'extensions/**/*.jison'; const lintGlobs = [ '**/*.js', + '**/*.ts', + '!**/*.d.ts', // To ignore a file / directory, add it to .eslintignore. ]; diff --git a/build-system/test-configs/forbidden-terms.js b/build-system/test-configs/forbidden-terms.js index 9cd54cfd7d8c..424b3c2fb570 100644 --- a/build-system/test-configs/forbidden-terms.js +++ b/build-system/test-configs/forbidden-terms.js @@ -144,6 +144,7 @@ const forbiddenTermsGlobal = { 'build-system/compile/build-compiler.js', 'build-system/compile/build-constants.js', 'src/core/mode/esm.js', + 'src/core/mode/globals.d.ts', 'src/core/mode/minified.js', 'src/core/mode/prod.js', 'src/core/mode/version.js', @@ -607,7 +608,7 @@ const forbiddenTermsGlobal = { '\\b(__)?AMP_EXP\\b': { message: 'Do not access AMP_EXP directly. Use isExperimentOn() to access config', - allowlist: ['src/experiments/index.js'], + allowlist: ['src/experiments/index.js', 'src/experiments/amp-globals.d.ts'], }, 'AMP_CONFIG': { message: diff --git a/examples/ac-creative.js b/examples/ac-creative.js index e0241f414054..46b2fad7b227 100644 --- a/examples/ac-creative.js +++ b/examples/ac-creative.js @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + if (!window.context) { // window.context doesn't exist yet, must perform steps to create it // before using it diff --git a/examples/pwa/pwa-sw.js b/examples/pwa/pwa-sw.js index f76f1aaac016..0139c350a5dc 100644 --- a/examples/pwa/pwa-sw.js +++ b/examples/pwa/pwa-sw.js @@ -1,6 +1,6 @@ 'use strict'; -self.addEventListener('install', (event) => {}); +self.addEventListener('install', () => {}); self.addEventListener('fetch', (event) => { // TODO(dvoytenko): use cache, implement one-behind. diff --git a/examples/pwa/pwa.js b/examples/pwa/pwa.js index 228b22be36de..32b569bb8a08 100644 --- a/examples/pwa/pwa.js +++ b/examples/pwa/pwa.js @@ -1,6 +1,6 @@ 'use strict'; -function log(args) { +function log() { var var_args = Array.prototype.slice.call(arguments, 0); var_args.unshift('[SHELL]'); console /*OK*/.log @@ -206,7 +206,7 @@ class AmpViewer { const isShadowDomSupported = Element.prototype.attachShadow || Element.prototype.createShadowRoot; - const shadowDomReadyPromise = new Promise((resolve, reject) => { + const shadowDomReadyPromise = new Promise((resolve) => { if (isShadowDomSupported) { resolve(); } else if ( @@ -355,7 +355,7 @@ class AmpViewer { return new URL(relativeUrlString, this.baseUrl_).origin; } - onMessage_(type, data, rsvp) {} + onMessage_() {} } /** @@ -506,4 +506,4 @@ function parseQueryString(queryString) { return params; } -var shell = new Shell(window, /* useStreaming */ true); +var shell = new Shell(window, /* useStreaming */ true); // eslint-disable-line @typescript-eslint/no-unused-vars diff --git a/extensions/amp-access/0.1/iframe-api/access-controller.js b/extensions/amp-access/0.1/iframe-api/access-controller.js index ea5e6cbaaf86..2fb25b1f587b 100644 --- a/extensions/amp-access/0.1/iframe-api/access-controller.js +++ b/extensions/amp-access/0.1/iframe-api/access-controller.js @@ -9,12 +9,12 @@ export class AccessController { /** * Check origin, protocol and configuration and initialize controller. - * @param {string} origin - * @param {string} protocol - * @param {!JsonObject} config + * @param {string} unusedOrigin + * @param {string} unusedProtocl + * @param {!JsonObject} unusedConfig * @return {!Promise|undefined} */ - connect(origin, protocol, config) {} + connect(unusedOrigin, unusedProtocl, unusedConfig) {} /** * Authorize document. diff --git a/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js b/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js index 6def32c030b2..eb429406b161 100644 --- a/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js +++ b/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js @@ -19,7 +19,7 @@ import {Services} from '#service'; import {AmpA4A} from '../../../amp-a4a/0.1/amp-a4a'; import {AmpAd} from '../../../amp-ad/0.1/amp-ad'; import { - AmpAdXOriginIframeHandler, // eslint-disable-line no-unused-vars + AmpAdXOriginIframeHandler, // eslint-disable-line @typescript-eslint/no-unused-vars } from '../../../amp-ad/0.1/amp-ad-xorigin-iframe-handler'; import { AmpAdNetworkAdsenseImpl, diff --git a/extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js b/extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js index 510fc90aeae8..9a4540696f2c 100644 --- a/extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js +++ b/extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js @@ -101,7 +101,7 @@ import { assignAdUrlToError, } from '../../amp-a4a/0.1/amp-a4a'; import { - RefreshManager, // eslint-disable-line no-unused-vars + RefreshManager, // eslint-disable-line @typescript-eslint/no-unused-vars getRefreshManager, } from '../../amp-a4a/0.1/refresh-manager'; import {AMP_SIGNATURE_HEADER} from '../../amp-a4a/0.1/signature-verifier'; diff --git a/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js b/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js index 0f5eaee2dd5d..af4ca16e4277 100644 --- a/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js +++ b/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js @@ -1,4 +1,4 @@ -import {AmpAd} from '../../../amp-ad/0.1/amp-ad'; // eslint-disable-line no-unused-vars +import {AmpAd} from '../../../amp-ad/0.1/amp-ad'; // eslint-disable-line @typescript-eslint/no-unused-vars import {AmpAdNetworkFakeImpl} from '../amp-ad-network-fake-impl'; describes.realWin( diff --git a/extensions/amp-ad-network-oblivki-impl/0.1/test/test-amp-ad-network-oblivki-impl.js b/extensions/amp-ad-network-oblivki-impl/0.1/test/test-amp-ad-network-oblivki-impl.js index 260d5dc3e584..032d2bdac789 100644 --- a/extensions/amp-ad-network-oblivki-impl/0.1/test/test-amp-ad-network-oblivki-impl.js +++ b/extensions/amp-ad-network-oblivki-impl/0.1/test/test-amp-ad-network-oblivki-impl.js @@ -1,10 +1,10 @@ import {createElementWithAttributes} from '#core/dom'; import { - AmpAdUIHandler, // eslint-disable-line no-unused-vars + AmpAdUIHandler, // eslint-disable-line @typescript-eslint/no-unused-vars } from '../../../amp-ad/0.1/amp-ad-ui'; import { - AmpAdXOriginIframeHandler, // eslint-disable-line no-unused-vars + AmpAdXOriginIframeHandler, // eslint-disable-line @typescript-eslint/no-unused-vars } from '../../../amp-ad/0.1/amp-ad-xorigin-iframe-handler'; import {AmpAdNetworkOblivkiImpl} from '../amp-ad-network-oblivki-impl'; import {oblivkiIsA4AEnabled} from '../oblivki-a4a-config'; diff --git a/extensions/amp-ad-network-smartads-impl/0.1/test/test-amp-ad-network-smartads-impl.js b/extensions/amp-ad-network-smartads-impl/0.1/test/test-amp-ad-network-smartads-impl.js index 1f7b9a9304a4..6b6be779d69a 100644 --- a/extensions/amp-ad-network-smartads-impl/0.1/test/test-amp-ad-network-smartads-impl.js +++ b/extensions/amp-ad-network-smartads-impl/0.1/test/test-amp-ad-network-smartads-impl.js @@ -1,10 +1,10 @@ import {createElementWithAttributes} from '#core/dom'; import { - AmpAdUIHandler, // eslint-disable-line no-unused-vars + AmpAdUIHandler, // eslint-disable-line @typescript-eslint/no-unused-vars } from '../../../amp-ad/0.1/amp-ad-ui'; import { - AmpAdXOriginIframeHandler, // eslint-disable-line no-unused-vars + AmpAdXOriginIframeHandler, // eslint-disable-line @typescript-eslint/no-unused-vars } from '../../../amp-ad/0.1/amp-ad-xorigin-iframe-handler'; import {AmpAdNetworkSmartAdsImpl} from '../amp-ad-network-smartads-impl'; import {smartAdsIsA4AEnabled} from '../smartads-a4a-config'; diff --git a/extensions/amp-ad/0.1/amp-ad-3p-impl.js b/extensions/amp-ad/0.1/amp-ad-3p-impl.js index 1ecfd361ab79..644f42336c43 100644 --- a/extensions/amp-ad/0.1/amp-ad-3p-impl.js +++ b/extensions/amp-ad/0.1/amp-ad-3p-impl.js @@ -5,11 +5,11 @@ import { import {AmpAdUIHandler} from './amp-ad-ui'; import {AmpAdXOriginIframeHandler} from './amp-ad-xorigin-iframe-handler'; import { - CONSENT_POLICY_STATE, // eslint-disable-line no-unused-vars + CONSENT_POLICY_STATE, // eslint-disable-line @typescript-eslint/no-unused-vars } from '#core/constants/consent-state'; import { LayoutPriority_Enum, - Layout_Enum, // eslint-disable-line no-unused-vars + Layout_Enum, // eslint-disable-line @typescript-eslint/no-unused-vars isLayoutSizeDefined, } from '#core/dom/layout'; import {Services} from '#service'; diff --git a/extensions/amp-animation/0.1/runners/animation-runner.js b/extensions/amp-animation/0.1/runners/animation-runner.js index 0af9d5561f29..8fced108a2e1 100644 --- a/extensions/amp-animation/0.1/runners/animation-runner.js +++ b/extensions/amp-animation/0.1/runners/animation-runner.js @@ -1,5 +1,5 @@ import { - WebAnimationPlayState, // eslint-disable-line no-unused-vars + WebAnimationPlayState, // eslint-disable-line @typescript-eslint/no-unused-vars } from '../web-animation-types'; /** diff --git a/extensions/amp-autocomplete/0.1/amp-autocomplete.js b/extensions/amp-autocomplete/0.1/amp-autocomplete.js index 5caf327cdaff..6a9e99a919e8 100644 --- a/extensions/amp-autocomplete/0.1/amp-autocomplete.js +++ b/extensions/amp-autocomplete/0.1/amp-autocomplete.js @@ -40,7 +40,7 @@ import fuzzysearch from '#third_party/fuzzysearch'; * selectedText: ?string * }} */ -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars let SelectionValues; const TAG = 'amp-autocomplete'; diff --git a/extensions/amp-consent/0.1/tcf-api-command-manager.js b/extensions/amp-consent/0.1/tcf-api-command-manager.js index 6459506ca05f..0e1994abf166 100644 --- a/extensions/amp-consent/0.1/tcf-api-command-manager.js +++ b/extensions/amp-consent/0.1/tcf-api-command-manager.js @@ -1,4 +1,4 @@ -import {ConsentPolicyManager} from './consent-policy-manager'; // eslint-disable-line no-unused-vars +import {ConsentPolicyManager} from './consent-policy-manager'; // eslint-disable-line @typescript-eslint/no-unused-vars import {TCF_POST_MESSAGE_API_COMMANDS} from './consent-info'; import {hasOwn, map} from '#core/types/object'; import {isEnumValue, isObject} from '#core/types'; diff --git a/extensions/amp-fx-collection/0.1/amp-fx-collection.js b/extensions/amp-fx-collection/0.1/amp-fx-collection.js index ff1c62c6aa1a..0ea2fde2037c 100644 --- a/extensions/amp-fx-collection/0.1/amp-fx-collection.js +++ b/extensions/amp-fx-collection/0.1/amp-fx-collection.js @@ -8,7 +8,7 @@ import {devAssert} from '#utils/log'; import { FxBindings, FxObservesSignal, - FxType, // eslint-disable-line no-unused-vars + FxType, // eslint-disable-line @typescript-eslint/no-unused-vars getFxTypes, } from './fx-type'; import { diff --git a/extensions/amp-fx-collection/0.1/providers/fx-provider.js b/extensions/amp-fx-collection/0.1/providers/fx-provider.js index 68b335a1af1f..699269a47cad 100644 --- a/extensions/amp-fx-collection/0.1/providers/fx-provider.js +++ b/extensions/amp-fx-collection/0.1/providers/fx-provider.js @@ -25,10 +25,10 @@ import { getServiceForDoc, registerServiceBuilderForDoc, } from '../../../../src/service-helpers'; -import {FxType} from '../fx-type'; // eslint-disable-line no-unused-vars +import {FxType} from '../fx-type'; // eslint-disable-line @typescript-eslint/no-unused-vars import { ScrollToggleDispatch, - ScrollTogglePosition, // eslint-disable-line no-unused-vars + ScrollTogglePosition, // eslint-disable-line @typescript-eslint/no-unused-vars assertValidScrollToggleElement, getScrollToggleFloatInOffset, getScrollTogglePosition, diff --git a/extensions/amp-intersection-observer-polyfill/0.1/amp-intersection-observer-polyfill.js b/extensions/amp-intersection-observer-polyfill/0.1/amp-intersection-observer-polyfill.js index 1cf294515245..9bd3a1ba76c5 100644 --- a/extensions/amp-intersection-observer-polyfill/0.1/amp-intersection-observer-polyfill.js +++ b/extensions/amp-intersection-observer-polyfill/0.1/amp-intersection-observer-polyfill.js @@ -28,7 +28,6 @@ export function upgradeIntersectionObserverPolyfill(win) { registerServiceBuilder(win, TAG, upgrade, /* instantiate */ true); } -// eslint-disable-next-line no-unused-vars -AMP.extension(TAG, '0.1', function (AMP) { +AMP.extension(TAG, '0.1', function (unusedAMP) { upgradeIntersectionObserverPolyfill(window); }); diff --git a/extensions/amp-lightbox-gallery/1.0/consumer.js b/extensions/amp-lightbox-gallery/1.0/consumer.js index e9ccc2571753..d0dbb3ccab03 100644 --- a/extensions/amp-lightbox-gallery/1.0/consumer.js +++ b/extensions/amp-lightbox-gallery/1.0/consumer.js @@ -59,7 +59,7 @@ export function WithBentoLightboxGallery({ return Children.map(children, CLONE_CHILD); } return ; - }, [children, renderProp, srcset]); + }, [children, renderProp, srcset, Comp]); const caption = useMemo( () => captionProp || alt || ariaLabel, diff --git a/extensions/amp-next-page/1.0/visibility-observer.js b/extensions/amp-next-page/1.0/visibility-observer.js index 1419a5e9045e..71c3bee3def0 100644 --- a/extensions/amp-next-page/1.0/visibility-observer.js +++ b/extensions/amp-next-page/1.0/visibility-observer.js @@ -3,7 +3,7 @@ import {throttle} from '#core/types/function'; import {Services} from '#service'; import { - PositionObserver, // eslint-disable-line no-unused-vars + PositionObserver, // eslint-disable-line @typescript-eslint/no-unused-vars installPositionObserverServiceForDoc, } from '#service/position-observer/position-observer-impl'; import { diff --git a/extensions/amp-resize-observer-polyfill/0.1/amp-resize-observer-polyfill.js b/extensions/amp-resize-observer-polyfill/0.1/amp-resize-observer-polyfill.js index cd0f230fdce4..a79993fdad4b 100644 --- a/extensions/amp-resize-observer-polyfill/0.1/amp-resize-observer-polyfill.js +++ b/extensions/amp-resize-observer-polyfill/0.1/amp-resize-observer-polyfill.js @@ -24,7 +24,7 @@ export function upgradeResizeObserverPolyfill(win) { registerServiceBuilder(win, TAG, upgrade, /* instantiate */ true); } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars AMP.extension(TAG, '0.1', function (AMP) { upgradeResizeObserverPolyfill(window); }); diff --git a/extensions/amp-story/1.0/amp-story-localization-service.js b/extensions/amp-story/1.0/amp-story-localization-service.js index 0fc4e5ab55d1..78f4eead6745 100644 --- a/extensions/amp-story/1.0/amp-story-localization-service.js +++ b/extensions/amp-story/1.0/amp-story-localization-service.js @@ -1,7 +1,7 @@ import {LocalizationService} from '#service/localization'; import {Services} from '#service'; import {registerServiceBuilderForDoc} from '../../../src/service-helpers'; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars import {LocalizedStringId_Enum} from '#service/localization/strings'; /** diff --git a/extensions/amp-viewer-integration/0.1/messaging/messaging.js b/extensions/amp-viewer-integration/0.1/messaging/messaging.js index f70e5d17141c..6d2d21d8a90e 100644 --- a/extensions/amp-viewer-integration/0.1/messaging/messaging.js +++ b/extensions/amp-viewer-integration/0.1/messaging/messaging.js @@ -14,7 +14,7 @@ const MessageType_Enum = { /** * @typedef {function(string, *, boolean):(!Promise<*>|undefined)} */ -let RequestHandler; // eslint-disable-line no-unused-vars +let RequestHandler; // eslint-disable-line @typescript-eslint/no-unused-vars /** * @param {*} message diff --git a/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js b/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js index 0a8c7483c5c3..ced590f5a9ad 100644 --- a/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js +++ b/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ import {Deferred} from '#core/data-structures/promise'; import {removeElement} from '#core/dom'; diff --git a/package-lock.json b/package-lock.json index 67abeff55e0c..bb8cdfda5302 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,6 @@ "@ampproject/google-closure-compiler": "20210601.0.0", "@ampproject/remapping": "1.0.1", "@babel/core": "7.15.0", - "@babel/eslint-parser": "7.15.0", "@babel/helper-module-imports": "7.14.5", "@babel/helper-plugin-test-runner": "7.14.5", "@babel/plugin-syntax-import-assertions": "7.14.5", @@ -52,12 +51,15 @@ "@octokit/rest": "18.12.0", "@sinonjs/fake-timers": "7.1.2", "@types/chai": "4.2.22", + "@types/dompurify": "2.3.2", "@types/eslint": "7.28.2", "@types/fs-extra": "9.0.13", "@types/klaw": "3.0.3", "@types/minimist": "1.2.2", "@types/mocha": "8.2.3", "@types/node": "14.17.32", + "@typescript-eslint/eslint-plugin": "5.9.1", + "@typescript-eslint/parser": "5.9.1", "acorn-globals": "6.0.0", "ajv": "8.6.3", "ajv-formats": "2.1.1", @@ -105,7 +107,6 @@ "eslint-plugin-react": "7.26.1", "eslint-plugin-react-hooks": "4.2.0", "eslint-plugin-sort-destructure-keys": "1.4.0", - "eslint-plugin-sort-requires": "2.1.0", "esprima": "4.0.1", "event-stream": "4.0.1", "events": "3.3.0", @@ -175,7 +176,7 @@ "tempy": "1.0.1", "terser": "5.9.0", "traverse": "0.6.6", - "typescript": "4.4.4", + "typescript": "4.5.4", "util": "0.12.4", "vinyl-fs": "3.0.3" } @@ -397,32 +398,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@babel/eslint-parser": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.0.tgz", - "integrity": "sha512-+gSPtjSBxOZz4Uh8Ggqu7HbfpB8cT1LwW0DnVVLZEJvzXauiD0Di3zszcBkRmfGGrLdYeHUwcflG7i3tr9kQlw==", - "dev": true, - "dependencies": { - "eslint-scope": "^5.1.1", - "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || >=14.0.0" - }, - "peerDependencies": { - "@babel/core": ">=7.11.0", - "eslint": ">=7.5.0" - } - }, - "node_modules/@babel/eslint-parser/node_modules/semver": { - "version": "6.3.0", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/generator": { "version": "7.15.8", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz", @@ -2071,8 +2046,9 @@ }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.1.1", @@ -2090,8 +2066,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2104,9 +2081,10 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.11.0", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -2119,21 +2097,24 @@ }, "node_modules/@eslint/eslintrc/node_modules/ignore": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -2314,8 +2295,9 @@ }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", "debug": "^4.1.1", @@ -2326,9 +2308,10 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.0", - "dev": true, - "license": "BSD-3-Clause" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -4047,6 +4030,15 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", "dev": true }, + "node_modules/@types/dompurify": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-2.3.2.tgz", + "integrity": "sha512-iht/O0jie/hDur39Z1NzjfOT/O9Kn2aWY99aqOn7lwsjSttEoMyGWvZIuAzZy0cNvAZdjmqySp7Z4d3GfBEGQw==", + "dev": true, + "dependencies": { + "@types/trusted-types": "*" + } + }, "node_modules/@types/eslint": { "version": "7.28.2", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.2.tgz", @@ -4152,6 +4144,12 @@ "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "node_modules/@types/trusted-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", + "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==", + "dev": true + }, "node_modules/@types/yargs": { "version": "15.0.13", "dev": true, @@ -4165,6 +4163,217 @@ "dev": true, "license": "MIT" }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz", + "integrity": "sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "5.9.1", + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/type-utils": "5.9.1", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz", + "integrity": "sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/typescript-estree": "5.9.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.1.tgz", + "integrity": "sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/typescript-estree": "5.9.1", + "debug": "^4.3.2" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz", + "integrity": "sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/visitor-keys": "5.9.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz", + "integrity": "sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "5.9.1", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.1.tgz", + "integrity": "sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz", + "integrity": "sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/visitor-keys": "5.9.1", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz", + "integrity": "sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.9.1", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "dev": true, @@ -4208,9 +4417,10 @@ } }, "node_modules/acorn": { - "version": "8.1.0", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -4240,8 +4450,9 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -8137,8 +8348,9 @@ }, "node_modules/eslint": { "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.3", @@ -8571,11 +8783,6 @@ "eslint": "3 - 8" } }, - "node_modules/eslint-plugin-sort-requires": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, "node_modules/eslint-scope": { "version": "5.1.1", "dev": true, @@ -8620,8 +8827,9 @@ }, "node_modules/eslint/node_modules/@babel/code-frame": { "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/highlight": "^7.10.4" } @@ -8803,8 +9011,9 @@ }, "node_modules/espree": { "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", @@ -8816,8 +9025,9 @@ }, "node_modules/espree/node_modules/acorn": { "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -8827,8 +9037,9 @@ }, "node_modules/espree/node_modules/eslint-visitor-keys": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=4" } @@ -11097,8 +11308,9 @@ }, "node_modules/import-fresh": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -11112,8 +11324,9 @@ }, "node_modules/import-fresh/node_modules/resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -11445,6 +11658,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-function": { "version": "1.0.2", "dev": true, @@ -15032,17 +15254,6 @@ } } }, - "node_modules/jsdom/node_modules/acorn": { - "version": "8.4.1", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/jsdom/node_modules/form-data": { "version": "3.0.1", "dev": true, @@ -16130,11 +16341,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.debounce": { "version": "4.0.8", "dev": true, @@ -16182,8 +16388,9 @@ }, "node_modules/lodash.truncate": { "version": "4.4.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true }, "node_modules/lodash.uniq": { "version": "4.5.0", @@ -18076,8 +18283,9 @@ }, "node_modules/parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -20476,14 +20684,6 @@ "dev": true, "license": "MIT" }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/snakeize": { "version": "0.1.0", "dev": true, @@ -20968,26 +21168,19 @@ "dev": true }, "node_modules/string-width": { - "version": "4.2.2", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/string-width/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/string.prototype.matchall": { "version": "4.0.5", "dev": true, @@ -21231,16 +21424,16 @@ } }, "node_modules/table": { - "version": "6.7.1", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=10.0.0" @@ -21248,8 +21441,9 @@ }, "node_modules/table/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -21262,8 +21456,9 @@ }, "node_modules/table/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -21273,21 +21468,15 @@ }, "node_modules/table/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/table/node_modules/slice-ansi": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -21804,6 +21993,21 @@ "version": "1.14.1", "license": "0BSD" }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "dev": true, @@ -21876,9 +22080,9 @@ } }, "node_modules/typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -23020,23 +23224,6 @@ } } }, - "@babel/eslint-parser": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.0.tgz", - "integrity": "sha512-+gSPtjSBxOZz4Uh8Ggqu7HbfpB8cT1LwW0DnVVLZEJvzXauiD0Di3zszcBkRmfGGrLdYeHUwcflG7i3tr9kQlw==", - "dev": true, - "requires": { - "eslint-scope": "^5.1.1", - "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "dev": true - } - } - }, "@babel/generator": { "version": "7.15.8", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz", @@ -24082,6 +24269,8 @@ }, "@eslint/eslintrc": { "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -24097,6 +24286,8 @@ "dependencies": { "ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -24106,7 +24297,9 @@ } }, "globals": { - "version": "13.11.0", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -24114,14 +24307,20 @@ }, "ignore": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "strip-json-comments": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true } } @@ -24252,6 +24451,8 @@ }, "@humanwhocodes/config-array": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.0", @@ -24260,7 +24461,9 @@ } }, "@humanwhocodes/object-schema": { - "version": "1.2.0", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "@istanbuljs/load-nyc-config": { @@ -25592,6 +25795,15 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", "dev": true }, + "@types/dompurify": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-2.3.2.tgz", + "integrity": "sha512-iht/O0jie/hDur39Z1NzjfOT/O9Kn2aWY99aqOn7lwsjSttEoMyGWvZIuAzZy0cNvAZdjmqySp7Z4d3GfBEGQw==", + "dev": true, + "requires": { + "@types/trusted-types": "*" + } + }, "@types/eslint": { "version": "7.28.2", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.2.tgz", @@ -25687,6 +25899,12 @@ "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "@types/trusted-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", + "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==", + "dev": true + }, "@types/yargs": { "version": "15.0.13", "dev": true, @@ -25698,6 +25916,120 @@ "version": "20.2.0", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz", + "integrity": "sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.9.1", + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/type-utils": "5.9.1", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz", + "integrity": "sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/typescript-estree": "5.9.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.1.tgz", + "integrity": "sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.9.1", + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/typescript-estree": "5.9.1", + "debug": "^4.3.2" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz", + "integrity": "sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/visitor-keys": "5.9.1" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz", + "integrity": "sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.9.1", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.1.tgz", + "integrity": "sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz", + "integrity": "sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.1", + "@typescript-eslint/visitor-keys": "5.9.1", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz", + "integrity": "sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.1", + "eslint-visitor-keys": "^3.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true + } + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "dev": true @@ -25729,7 +26061,9 @@ } }, "acorn": { - "version": "8.1.0", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, "acorn-globals": { @@ -25748,6 +26082,8 @@ }, "acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, @@ -28370,6 +28706,8 @@ }, "eslint": { "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", @@ -28416,6 +28754,8 @@ "dependencies": { "@babel/code-frame": { "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, "requires": { "@babel/highlight": "^7.10.4" @@ -28785,10 +29125,6 @@ "natural-compare-lite": "^1.4.0" } }, - "eslint-plugin-sort-requires": { - "version": "2.1.0", - "dev": true - }, "eslint-scope": { "version": "5.1.1", "dev": true, @@ -28816,6 +29152,8 @@ }, "espree": { "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "requires": { "acorn": "^7.4.0", @@ -28825,10 +29163,14 @@ "dependencies": { "acorn": { "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, "eslint-visitor-keys": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true } } @@ -30437,6 +30779,8 @@ }, "import-fresh": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -30445,6 +30789,8 @@ "dependencies": { "resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true } } @@ -30652,6 +30998,12 @@ "version": "2.1.1", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "is-function": { "version": "1.0.2", "dev": true @@ -33310,10 +33662,6 @@ "xml-name-validator": "^3.0.0" }, "dependencies": { - "acorn": { - "version": "8.4.1", - "dev": true - }, "form-data": { "version": "3.0.1", "dev": true, @@ -34103,10 +34451,6 @@ "version": "4.3.0", "dev": true }, - "lodash.clonedeep": { - "version": "4.5.0", - "dev": true - }, "lodash.debounce": { "version": "4.0.8", "dev": true @@ -34145,6 +34489,8 @@ }, "lodash.truncate": { "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, "lodash.uniq": { @@ -35377,6 +35723,8 @@ }, "parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "requires": { "callsites": "^3.0.0" @@ -36934,10 +37282,6 @@ "color-name": { "version": "1.1.4", "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true } } }, @@ -37305,18 +37649,14 @@ "dev": true }, "string-width": { - "version": "4.2.2", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true - } + "strip-ansi": "^6.0.1" } }, "string.prototype.matchall": { @@ -37489,19 +37829,22 @@ } }, "table": { - "version": "6.7.1", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", "dev": true, "requires": { "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" }, "dependencies": { "ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" @@ -37509,6 +37852,8 @@ }, "color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -37516,14 +37861,14 @@ }, "color-name": { "version": "1.1.4", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "slice-ansi": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -37893,6 +38238,15 @@ "tslib": { "version": "1.14.1" }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "dev": true, @@ -37939,9 +38293,9 @@ } }, "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true }, "ua-parser-js": { diff --git a/package.json b/package.json index e39d35faf594..be317f1deefd 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "@ampproject/google-closure-compiler": "20210601.0.0", "@ampproject/remapping": "1.0.1", "@babel/core": "7.15.0", - "@babel/eslint-parser": "7.15.0", "@babel/helper-module-imports": "7.14.5", "@babel/helper-plugin-test-runner": "7.14.5", "@babel/plugin-syntax-import-assertions": "7.14.5", @@ -57,12 +56,15 @@ "@octokit/rest": "18.12.0", "@sinonjs/fake-timers": "7.1.2", "@types/chai": "4.2.22", + "@types/dompurify": "2.3.2", "@types/eslint": "7.28.2", "@types/fs-extra": "9.0.13", "@types/klaw": "3.0.3", "@types/minimist": "1.2.2", "@types/mocha": "8.2.3", "@types/node": "14.17.32", + "@typescript-eslint/eslint-plugin": "5.9.1", + "@typescript-eslint/parser": "5.9.1", "acorn-globals": "6.0.0", "ajv": "8.6.3", "ajv-formats": "2.1.1", @@ -110,7 +112,6 @@ "eslint-plugin-react": "7.26.1", "eslint-plugin-react-hooks": "4.2.0", "eslint-plugin-sort-destructure-keys": "1.4.0", - "eslint-plugin-sort-requires": "2.1.0", "esprima": "4.0.1", "event-stream": "4.0.1", "events": "3.3.0", @@ -180,7 +181,7 @@ "tempy": "1.0.1", "terser": "5.9.0", "traverse": "0.6.6", - "typescript": "4.4.4", + "typescript": "4.5.4", "util": "0.12.4", "vinyl-fs": "3.0.3" } diff --git a/src/compiler/types.d.ts b/src/compiler/types.d.ts index 95acea41f05d..17d939a21704 100644 --- a/src/compiler/types.d.ts +++ b/src/compiler/types.d.ts @@ -1,4 +1,4 @@ -import {TreeProto, NodeProto} from '@ampproject/bento-compiler'; +import {NodeProto, TreeProto} from '@ampproject/bento-compiler'; /** * AMP Components must implement this "buildDom" function in order to be server-rendered. diff --git a/src/consent.js b/src/consent.js index d39cd63234f3..41b643c54a95 100644 --- a/src/consent.js +++ b/src/consent.js @@ -1,6 +1,3 @@ -import { - CONSENT_POLICY_STATE, // eslint-disable-line no-unused-vars -} from '#core/constants/consent-state'; import {dict} from '#core/types/object'; import {Services} from '#service'; @@ -10,7 +7,7 @@ import {Services} from '#service'; * for resolve. Or if consent service is not available. * @param {!Element|!ShadowRoot} element * @param {string=} policyId - * @return {!Promise} + * @return {!Promise} */ export function getConsentPolicyState(element, policyId = 'default') { return Services.consentPolicyServiceForDocOrNull(element).then( diff --git a/src/core/mode/globals.d.ts b/src/core/mode/globals.d.ts index dc036b4cb573..f18b94119cc6 100644 --- a/src/core/mode/globals.d.ts +++ b/src/core/mode/globals.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable local/no-forbidden-terms */ export {}; declare global { diff --git a/src/purifier/index.d.ts b/src/purifier/index.d.ts index eb257974880a..d33bdbc39200 100644 --- a/src/purifier/index.d.ts +++ b/src/purifier/index.d.ts @@ -1,5 +1,3 @@ -/// - export type AttributeRewriterDef = ( tagName: string, attrName: string, diff --git a/src/runtime.js b/src/runtime.js index 0f43ce10ac20..b93edc60eea0 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -19,7 +19,6 @@ import { } from '#service/extensions-impl'; import { - LogLevel_Enum, // eslint-disable-line no-unused-vars dev, initLogConstructor, overrideLogLevel, @@ -149,7 +148,7 @@ function adoptShared(global, callback) { global.AMP.toggleExperiment = toggleExperiment.bind(null, global); /** - * @param {!LogLevel_Enum} level + * @param {import('#utils/log').LogLevel_Enum} level */ global.AMP.setLogLevel = overrideLogLevel.bind(null); diff --git a/src/service/localization/index.js b/src/service/localization/index.js index b7f754e33f05..33c06b826823 100644 --- a/src/service/localization/index.js +++ b/src/service/localization/index.js @@ -7,7 +7,7 @@ import { // The LocalizedStringId_Enum type is imported even though it is not used because // the compiler does not output types for enums, but we want to distinguish // between LocalizedStringId_Enum enum values and any other strings. - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars LocalizedStringId_Enum, } from './strings'; diff --git a/src/service/mutator-interface.js b/src/service/mutator-interface.js index a43e03fcf71e..70307c600dfd 100644 --- a/src/service/mutator-interface.js +++ b/src/service/mutator-interface.js @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /** * @interface */ diff --git a/src/service/owners-interface.js b/src/service/owners-interface.js index 2313e4dfeaf3..dc1b0e19ead3 100644 --- a/src/service/owners-interface.js +++ b/src/service/owners-interface.js @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /** * @interface */ diff --git a/src/service/position-observer/position-observer-impl.js b/src/service/position-observer/position-observer-impl.js index cd7181706503..abb496f54a38 100644 --- a/src/service/position-observer/position-observer-impl.js +++ b/src/service/position-observer/position-observer-impl.js @@ -5,7 +5,7 @@ import {Services} from '#service'; import {dev} from '#utils/log'; import { - PositionObserverFidelity_Enum, // eslint-disable-line no-unused-vars + PositionObserverFidelity_Enum, // eslint-disable-line @typescript-eslint/no-unused-vars PositionObserverWorker, } from './position-observer-worker'; diff --git a/src/service/resources-interface.js b/src/service/resources-interface.js index 8ee3a4dbc195..bda97cc7cb24 100644 --- a/src/service/resources-interface.js +++ b/src/service/resources-interface.js @@ -24,7 +24,7 @@ export let MarginChangeDef; */ export let ChangeSizeRequestDef; -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /** * @interface */ diff --git a/src/service/viewer-interface.js b/src/service/viewer-interface.js index 6c0d8b650422..7e9046985533 100644 --- a/src/service/viewer-interface.js +++ b/src/service/viewer-interface.js @@ -3,7 +3,7 @@ */ export let RequestResponderDef; -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /** * @interface */ diff --git a/src/service/viewport/viewport-interface.js b/src/service/viewport/viewport-interface.js index 8784f6537993..96108e337f47 100644 --- a/src/service/viewport/viewport-interface.js +++ b/src/service/viewport/viewport-interface.js @@ -21,7 +21,7 @@ export let ViewportChangedEventDef; */ export let ViewportResizedEventDef; -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /** * @interface */ diff --git a/src/utils/log.d.ts b/src/utils/log.d.ts index fab44e104046..19646faf64b6 100644 --- a/src/utils/log.d.ts +++ b/src/utils/log.d.ts @@ -6,3 +6,11 @@ export interface Logger { export const user: () => Logger; export const dev: () => Logger; + +export type LogLevel_Enum = { + OFF: 0; + ERROR: 1; + WARN: 2; + INFO: 3; + FINE: 4; +}; diff --git a/test/unit/test-vsync.js b/test/unit/test-vsync.js index 3ab6bfa6e808..895d55bd96ee 100644 --- a/test/unit/test-vsync.js +++ b/test/unit/test-vsync.js @@ -429,10 +429,10 @@ describes.fakeWin('vsync', {}, (env) => { vsync.raf_ = (handler) => (rafHandler = handler); isVisibleStub.returns(false); - let result = ''; // eslint-disable-line no-unused-vars + let result = ''; const res = vsync.runAnim(contextNode, { mutate: () => { - result += 'mu1'; + result += 'mu1'; // eslint-disable-line @typescript-eslint/no-unused-vars }, }); @@ -446,10 +446,10 @@ describes.fakeWin('vsync', {}, (env) => { vsync.raf_ = (handler) => (rafHandler = handler); isVisibleStub.returns(false); - let result = ''; // eslint-disable-line no-unused-vars + let result = ''; const task = vsync.createAnimTask(contextNode, { mutate: () => { - result += 'mu1'; + result += 'mu1'; // eslint-disable-line @typescript-eslint/no-unused-vars }, }); const res = task(); @@ -709,10 +709,10 @@ describes.fakeWin('vsync', {}, (env) => { vsync.raf_ = (handler) => (rafHandler = handler); doc.visibilityState = 'hidden'; - let result = ''; // eslint-disable-line no-unused-vars + let result = ''; const res = vsync.runAnim(contextNode, { mutate: () => { - result += 'mu1'; + result += 'mu1'; // eslint-disable-line @typescript-eslint/no-unused-vars }, }); @@ -726,10 +726,10 @@ describes.fakeWin('vsync', {}, (env) => { vsync.raf_ = (handler) => (rafHandler = handler); doc.visibilityState = 'hidden'; - let result = ''; // eslint-disable-line no-unused-vars + let result = ''; const task = vsync.createAnimTask(contextNode, { mutate: () => { - result += 'mu1'; + result += 'mu1'; // eslint-disable-line @typescript-eslint/no-unused-vars }, }); const res = task(); diff --git a/testing/amp-performance-extension/measure.js b/testing/amp-performance-extension/measure.js index d3b84f6549ab..217758db6529 100644 --- a/testing/amp-performance-extension/measure.js +++ b/testing/amp-performance-extension/measure.js @@ -1,5 +1,5 @@ let cumulativeLayoutShift, largestContentfulPaint, longTasks; -let measureStarted; // eslint-disable-line no-unused-vars +let measureStarted; function renderMeasurement(container, label, count) { container./*OK*/ innerHTML += `
@@ -60,7 +60,7 @@ function measureLongTasks() { } function measureTimeToInteractive() { - measureStarted = Date.now(); + measureStarted = Date.now(); // eslint-disable-line @typescript-eslint/no-unused-vars } function getMaxFirstInputDelay(firstContentfulPaint) { diff --git a/third_party/subscriptions-project/swg.js b/third_party/subscriptions-project/swg.js index dbb8a0d47f9a..06fdc77fed6c 100644 --- a/third_party/subscriptions-project/swg.js +++ b/third_party/subscriptions-project/swg.js @@ -2091,7 +2091,7 @@ const FilterResult = { */ let ClientEvent; -/* eslint-disable no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /** * @interface */