From 96b7e8ee0f5280cab50a7205ae592e1d983a111a Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 6 Dec 2021 10:04:38 -0800 Subject: [PATCH 01/19] feat(eslint-plugin): [no-shadow] support TS4.5 inline import specifiers (#4239) --- packages/eslint-plugin/src/rules/no-shadow.ts | 4 +- .../tests/rules/no-shadow.test.ts | 85 ++++++++++++++++++- 2 files changed, 87 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index dfba42cf301e..68214ddd3383 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -98,7 +98,9 @@ export default util.createRule({ ): definition is ImportBindingDefinition { return ( definition?.type === DefinitionType.ImportBinding && - definition.parent.importKind === 'type' + (definition.parent.importKind === 'type' || + (definition.node.type === AST_NODE_TYPES.ImportSpecifier && + definition.node.importKind === 'type')) ); } diff --git a/packages/eslint-plugin/tests/rules/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow.test.ts index bedb825df704..929ddf9d389e 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow.test.ts @@ -193,6 +193,15 @@ function doThing(foo: number, bar: number) {} `, options: [{ ignoreTypeValueShadow: true }], }, + { + code: ` +import { type foo } from './foo'; + +// 'foo' is already declared in the upper scope +function doThing(foo: number) {} + `, + options: [{ ignoreTypeValueShadow: true }], + }, ], invalid: [ { @@ -1422,7 +1431,23 @@ function foo(cb) { { code: ` import type { foo } from './foo'; -function doThing(foo: number, bar: number) {} +function doThing(foo: number) {} + `, + options: [{ ignoreTypeValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { name: 'foo' }, + type: AST_NODE_TYPES.Identifier, + line: 3, + column: 18, + }, + ], + }, + { + code: ` +import { type foo } from './foo'; +function doThing(foo: number) {} `, options: [{ ignoreTypeValueShadow: false }], errors: [ @@ -1513,6 +1538,64 @@ declare module 'bar' { code: ` import type { Foo } from 'bar'; +declare module 'bar' { + interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'Foo' }, + type: AST_NODE_TYPES.Identifier, + line: 5, + column: 13, + }, + ], + }, + { + code: ` +import { type Foo } from 'bar'; + +declare module 'baz' { + export interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'Foo' }, + type: AST_NODE_TYPES.Identifier, + line: 5, + column: 20, + }, + ], + }, + { + code: ` +import { type Foo } from 'bar'; + +declare module 'bar' { + export type Foo = string; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'Foo' }, + type: AST_NODE_TYPES.Identifier, + line: 5, + column: 15, + }, + ], + }, + { + code: ` +import { type Foo } from 'bar'; + declare module 'bar' { interface Foo { x: string; From be4d976215614cc032730ae596d2f6e47df67730 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 6 Dec 2021 10:04:51 -0800 Subject: [PATCH 02/19] feat(eslint-plugin): [consistent-type-exports] support TS4.5 inline export specifiers (#4236) --- .../docs/rules/consistent-type-exports.md | 49 +++++- .../src/rules/consistent-type-exports.ts | 161 ++++++++++++------ .../rules/consistent-type-exports.test.ts | 148 +++++++++++++++- 3 files changed, 302 insertions(+), 56 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 71303d3659e8..3c02e38d29c9 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -11,6 +11,51 @@ This rule aims to standardize the use of type exports style across a codebase. Given a class `Button`, and an interface `ButtonProps`, examples of code: +## Options + +```ts +interface Options { + fixMixedExportsWithInlineTypeSpecifier?: boolean; +} + +const defaultOptions: Options = { + fixMixedExportsWithInlineTypeSpecifier: false, +}; +``` + +### `fixMixedExportsWithInlineTypeSpecifier` + +When this is set to true, the rule will autofix "mixed" export cases using TS 4.5's "inline type specifier". +If you are using a TypeScript version less than 4.5, then you will not be able to use this option. + +For example the following code: + +```ts +const x = 1; +type T = number; + +export { x, T }; +``` + +With `{fixMixedExportsWithInlineTypeSpecifier: true}` will be fixed to: + +```ts +const x = 1; +type T = number; + +export { x, type T }; +``` + +With `{fixMixedExportsWithInlineTypeSpecifier: false}` will be fixed to: + +```ts +const x = 1; +type T = number; + +export type { T }; +export { x }; +``` + ### ❌ Incorrect @@ -23,7 +68,9 @@ export type { ButtonProps } from 'some-library'; ### ✅ Correct ```ts -export { Button, ButtonProps } from 'some-library'; +export { Button } from 'some-library'; +export type { ButtonProps } from 'some-library'; +export { Button, type ButtonProps } from 'some-library'; ``` ## When Not To Use It diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts index 98e6bd355e4c..7ad52679226d 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts @@ -7,7 +7,11 @@ import { import { SymbolFlags } from 'typescript'; import * as util from '../util'; -type Options = []; +type Options = [ + { + fixMixedExportsWithInlineTypeSpecifier: boolean; + }, +]; interface SourceExports { source: string; @@ -18,8 +22,9 @@ interface SourceExports { interface ReportValueExport { node: TSESTree.ExportNamedDeclaration; - typeSpecifiers: TSESTree.ExportSpecifier[]; + typeBasedSpecifiers: TSESTree.ExportSpecifier[]; valueSpecifiers: TSESTree.ExportSpecifier[]; + inlineTypeSpecifiers: TSESTree.ExportSpecifier[]; } type MessageIds = @@ -29,7 +34,6 @@ type MessageIds = export default util.createRule({ name: 'consistent-type-exports', - defaultOptions: [], meta: { type: 'suggestion', docs: { @@ -46,11 +50,26 @@ export default util.createRule({ multipleExportsAreTypes: 'Type exports {{exportNames}} are not values and should be exported using `export type`.', }, - schema: [], + schema: [ + { + type: 'object', + properties: { + fixMixedExportsWithInlineTypeSpecifier: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], fixable: 'code', }, + defaultOptions: [ + { + fixMixedExportsWithInlineTypeSpecifier: false, + }, + ], - create(context) { + create(context, [{ fixMixedExportsWithInlineTypeSpecifier }]) { const sourceCode = context.getSourceCode(); const sourceExportsMap: { [key: string]: SourceExports } = {}; const parserServices = util.getParserServices(context); @@ -69,27 +88,33 @@ export default util.createRule({ // Cache the first encountered exports for the package. We will need to come // back to these later when fixing the problems. if (node.exportKind === 'type') { - if (!sourceExports.typeOnlyNamedExport) { + if (sourceExports.typeOnlyNamedExport == null) { // The export is a type export sourceExports.typeOnlyNamedExport = node; } - } else if (!sourceExports.valueOnlyNamedExport) { + } else if (sourceExports.valueOnlyNamedExport == null) { // The export is a value export sourceExports.valueOnlyNamedExport = node; } // Next for the current export, we will separate type/value specifiers. - const typeSpecifiers: TSESTree.ExportSpecifier[] = []; + const typeBasedSpecifiers: TSESTree.ExportSpecifier[] = []; + const inlineTypeSpecifiers: TSESTree.ExportSpecifier[] = []; const valueSpecifiers: TSESTree.ExportSpecifier[] = []; // Note: it is valid to export values as types. We will avoid reporting errors // when this is encountered. if (node.exportKind !== 'type') { for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + inlineTypeSpecifiers.push(specifier); + continue; + } + const isTypeBased = isSpecifierTypeBased(parserServices, specifier); if (isTypeBased === true) { - typeSpecifiers.push(specifier); + typeBasedSpecifiers.push(specifier); } else if (isTypeBased === false) { // When isTypeBased is undefined, we should avoid reporting them. valueSpecifiers.push(specifier); @@ -98,13 +123,14 @@ export default util.createRule({ } if ( - (node.exportKind === 'value' && typeSpecifiers.length) || + (node.exportKind === 'value' && typeBasedSpecifiers.length) || (node.exportKind === 'type' && valueSpecifiers.length) ) { sourceExports.reportValueExports.push({ node, - typeSpecifiers, + typeBasedSpecifiers, valueSpecifiers, + inlineTypeSpecifiers, }); } }, @@ -117,8 +143,8 @@ export default util.createRule({ } for (const report of sourceExports.reportValueExports) { - if (!report.valueSpecifiers.length) { - // Export is all type-only; convert the entire export to `export type`. + if (report.valueSpecifiers.length === 0) { + // Export is all type-only with no type specifiers; convert the entire export to `export type`. context.report({ node: report.node, messageId: 'typeOverValue', @@ -126,35 +152,44 @@ export default util.createRule({ yield* fixExportInsertType(fixer, sourceCode, report.node); }, }); - } else { - // We have both type and value violations. - const allExportNames = report.typeSpecifiers.map( - specifier => `${specifier.local.name}`, - ); - - if (allExportNames.length === 1) { - const exportNames = allExportNames[0]; - - context.report({ - node: report.node, - messageId: 'singleExportIsType', - data: { exportNames }, - *fix(fixer) { + continue; + } + + // We have both type and value violations. + const allExportNames = report.typeBasedSpecifiers.map( + specifier => `${specifier.local.name}`, + ); + + if (allExportNames.length === 1) { + const exportNames = allExportNames[0]; + + context.report({ + node: report.node, + messageId: 'singleExportIsType', + data: { exportNames }, + *fix(fixer) { + if (fixMixedExportsWithInlineTypeSpecifier) { + yield* fixAddTypeSpecifierToNamedExports(fixer, report); + } else { yield* fixSeparateNamedExports(fixer, sourceCode, report); - }, - }); - } else { - const exportNames = util.formatWordList(allExportNames); - - context.report({ - node: report.node, - messageId: 'multipleExportsAreTypes', - data: { exportNames }, - *fix(fixer) { + } + }, + }); + } else { + const exportNames = util.formatWordList(allExportNames); + + context.report({ + node: report.node, + messageId: 'multipleExportsAreTypes', + data: { exportNames }, + *fix(fixer) { + if (fixMixedExportsWithInlineTypeSpecifier) { + yield* fixAddTypeSpecifierToNamedExports(fixer, report); + } else { yield* fixSeparateNamedExports(fixer, sourceCode, report); - }, - }); - } + } + }, + }); } } } @@ -205,6 +240,23 @@ function* fixExportInsertType( ); yield fixer.insertTextAfter(exportToken, ' type'); + + for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + const kindToken = util.nullThrows( + sourceCode.getFirstToken(specifier), + util.NullThrowsReasons.MissingToken('export', specifier.type), + ); + const firstTokenAfter = util.nullThrows( + sourceCode.getTokenAfter(kindToken, { + includeComments: true, + }), + 'Missing token following the export kind.', + ); + + yield fixer.removeRange([kindToken.range[0], firstTokenAfter.range[0]]); + } + } } /** @@ -217,11 +269,11 @@ function* fixSeparateNamedExports( sourceCode: Readonly, report: ReportValueExport, ): IterableIterator { - const { node, typeSpecifiers, valueSpecifiers } = report; + const { node, typeBasedSpecifiers, inlineTypeSpecifiers, valueSpecifiers } = + report; + const typeSpecifiers = typeBasedSpecifiers.concat(inlineTypeSpecifiers); const source = getSourceFromExport(node); - const separateTypes = node.exportKind !== 'type'; - const specifiersToSeparate = separateTypes ? typeSpecifiers : valueSpecifiers; - const specifierNames = specifiersToSeparate.map(getSpecifierText).join(', '); + const specifierNames = typeSpecifiers.map(getSpecifierText).join(', '); const exportToken = util.nullThrows( sourceCode.getFirstToken(node), @@ -229,9 +281,7 @@ function* fixSeparateNamedExports( ); // Filter the bad exports from the current line. - const filteredSpecifierNames = ( - separateTypes ? valueSpecifiers : typeSpecifiers - ) + const filteredSpecifierNames = valueSpecifiers .map(getSpecifierText) .join(', '); const openToken = util.nullThrows( @@ -252,12 +302,23 @@ function* fixSeparateNamedExports( // Insert the bad exports into a new export line above. yield fixer.insertTextBefore( exportToken, - `export ${separateTypes ? 'type ' : ''}{ ${specifierNames} }${ - source ? ` from '${source}'` : '' - };\n`, + `export type { ${specifierNames} }${source ? ` from '${source}'` : ''};\n`, ); } +function* fixAddTypeSpecifierToNamedExports( + fixer: TSESLint.RuleFixer, + report: ReportValueExport, +): IterableIterator { + if (report.node.exportKind === 'type') { + return; + } + + for (const specifier of report.typeBasedSpecifiers) { + yield fixer.insertTextBefore(specifier, 'type '); + } +} + /** * Returns the source of the export, or undefined if the named export has no source. */ diff --git a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts index 301d70e54dc3..561660a7f456 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/consistent-type-exports'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { RuleTester, getFixturesRootDir, noFormat } from '../RuleTester'; const rootDir = getFixturesRootDir(); @@ -106,8 +106,7 @@ export { CatchScope, } from '@typescript-eslint/scope-manager'; `, - // eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting - output: ` + output: noFormat` export type { AnalyzeOptions, Definition } from '@typescript-eslint/scope-manager'; export { BlockScope, CatchScope } from '@typescript-eslint/scope-manager'; `, @@ -158,8 +157,7 @@ export { CatchScope as CScope, } from '@typescript-eslint/scope-manager'; `, - // eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting - output: ` + output: noFormat` export type { Definition as Foo } from '@typescript-eslint/scope-manager'; export { BlockScope as BScope, CatchScope as CScope } from '@typescript-eslint/scope-manager'; `, @@ -259,5 +257,145 @@ export type { TypeNS }; }, ], }, + { + code: ` +type T = 1; +export { type T, T }; + `, + output: ` +type T = 1; +export type { T, T }; + `, + errors: [ + { + messageId: 'typeOverValue', + line: 3, + column: 1, + }, + ], + }, + { + code: noFormat` +type T = 1; +export { type/* */T, type /* */T, T }; + `, + output: noFormat` +type T = 1; +export type { /* */T, /* */T, T }; + `, + errors: [ + { + messageId: 'typeOverValue', + line: 3, + column: 1, + }, + ], + }, + { + code: ` +type T = 1; +const x = 1; +export { type T, T, x }; + `, + output: ` +type T = 1; +const x = 1; +export type { T, T }; +export { x }; + `, + errors: [ + { + messageId: 'singleExportIsType', + line: 4, + column: 1, + }, + ], + }, + { + code: ` +type T = 1; +const x = 1; +export { T, x }; + `, + output: ` +type T = 1; +const x = 1; +export { type T, x }; + `, + options: [{ fixMixedExportsWithInlineTypeSpecifier: true }], + errors: [ + { + messageId: 'singleExportIsType', + line: 4, + column: 1, + }, + ], + }, + { + code: ` +type T = 1; +export { type T, T }; + `, + output: ` +type T = 1; +export type { T, T }; + `, + options: [{ fixMixedExportsWithInlineTypeSpecifier: true }], + errors: [ + { + messageId: 'typeOverValue', + line: 3, + column: 1, + }, + ], + }, + { + code: ` +export { + AnalyzeOptions, + Definition as Foo, + type BlockScope as BScope, + CatchScope as CScope, +} from '@typescript-eslint/scope-manager'; + `, + output: noFormat` +export type { AnalyzeOptions, Definition as Foo, BlockScope as BScope } from '@typescript-eslint/scope-manager'; +export { CatchScope as CScope } from '@typescript-eslint/scope-manager'; + `, + options: [{ fixMixedExportsWithInlineTypeSpecifier: false }], + errors: [ + { + messageId: 'multipleExportsAreTypes', + line: 2, + column: 1, + }, + ], + }, + { + code: ` +export { + AnalyzeOptions, + Definition as Foo, + type BlockScope as BScope, + CatchScope as CScope, +} from '@typescript-eslint/scope-manager'; + `, + output: noFormat` +export { + type AnalyzeOptions, + type Definition as Foo, + type BlockScope as BScope, + CatchScope as CScope, +} from '@typescript-eslint/scope-manager'; + `, + options: [{ fixMixedExportsWithInlineTypeSpecifier: true }], + errors: [ + { + messageId: 'multipleExportsAreTypes', + line: 2, + column: 1, + }, + ], + }, ], }); From f61af7c53cca52f81e77b4334c7d6ad100609af6 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 6 Dec 2021 10:04:59 -0800 Subject: [PATCH 03/19] feat(eslint-plugin): [consistent-type-imports] support TS4.5 inline import specifiers (#4237) --- .../src/rules/consistent-type-imports.ts | 137 ++++++++++++------ .../rules/consistent-type-imports.test.ts | 45 ++++++ 2 files changed, 139 insertions(+), 43 deletions(-) diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts index d549ab8f7289..538c89c3cf3b 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts @@ -28,6 +28,7 @@ interface ReportValueImport { typeSpecifiers: TSESTree.ImportClause[]; // It has at least one element. valueSpecifiers: TSESTree.ImportClause[]; unusedSpecifiers: TSESTree.ImportClause[]; + inlineTypeSpecifiers: TSESTree.ImportSpecifier[]; } function isImportToken( @@ -106,7 +107,7 @@ export default util.createRule({ ...(prefer === 'type-imports' ? { // prefer type imports - ImportDeclaration(node: TSESTree.ImportDeclaration): void { + ImportDeclaration(node): void { const source = node.source.value; const sourceImports = sourceImportsMap[source] ?? @@ -139,9 +140,18 @@ export default util.createRule({ } const typeSpecifiers: TSESTree.ImportClause[] = []; + const inlineTypeSpecifiers: TSESTree.ImportSpecifier[] = []; const valueSpecifiers: TSESTree.ImportClause[] = []; const unusedSpecifiers: TSESTree.ImportClause[] = []; for (const specifier of node.specifiers) { + if ( + specifier.type === AST_NODE_TYPES.ImportSpecifier && + specifier.importKind === 'type' + ) { + inlineTypeSpecifiers.push(specifier); + continue; + } + const [variable] = context.getDeclaredVariables(specifier); if (variable.references.length === 0) { unusedSpecifiers.push(specifier); @@ -229,6 +239,7 @@ export default util.createRule({ typeSpecifiers, valueSpecifiers, unusedSpecifiers, + inlineTypeSpecifiers, }); } }, @@ -247,7 +258,11 @@ export default util.createRule({ node: report.node, messageId: 'typeOverValue', *fix(fixer) { - yield* fixToTypeImport(fixer, report, sourceImports); + yield* fixToTypeImportDeclaration( + fixer, + report, + sourceImports, + ); }, }); } else { @@ -298,13 +313,17 @@ export default util.createRule({ ...message, *fix(fixer) { if (isTypeImport) { - yield* fixToValueImportInDecoMeta( + yield* fixToValueImportDeclaration( fixer, report, sourceImports, ); } else { - yield* fixToTypeImport(fixer, report, sourceImports); + yield* fixToTypeImportDeclaration( + fixer, + report, + sourceImports, + ); } }, }); @@ -322,7 +341,21 @@ export default util.createRule({ node, messageId: 'valueOverType', fix(fixer) { - return fixToValueImport(fixer, node); + return fixRemoveTypeSpecifierFromImportDeclaration( + fixer, + node, + ); + }, + }); + }, + 'ImportSpecifier[importKind = "type"]'( + node: TSESTree.ImportSpecifier, + ): void { + context.report({ + node, + messageId: 'valueOverType', + fix(fixer) { + return fixRemoveTypeSpecifierFromImportSpecifier(fixer, node); }, }); }, @@ -345,20 +378,19 @@ export default util.createRule({ namespaceSpecifier: TSESTree.ImportNamespaceSpecifier | null; namedSpecifiers: TSESTree.ImportSpecifier[]; } { - const defaultSpecifier: TSESTree.ImportDefaultSpecifier | null = + const defaultSpecifier = node.specifiers[0].type === AST_NODE_TYPES.ImportDefaultSpecifier ? node.specifiers[0] : null; - const namespaceSpecifier: TSESTree.ImportNamespaceSpecifier | null = + const namespaceSpecifier = node.specifiers.find( (specifier): specifier is TSESTree.ImportNamespaceSpecifier => specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier, ) ?? null; - const namedSpecifiers: TSESTree.ImportSpecifier[] = - node.specifiers.filter( - (specifier): specifier is TSESTree.ImportSpecifier => - specifier.type === AST_NODE_TYPES.ImportSpecifier, - ); + const namedSpecifiers = node.specifiers.filter( + (specifier): specifier is TSESTree.ImportSpecifier => + specifier.type === AST_NODE_TYPES.ImportSpecifier, + ); return { defaultSpecifier, namespaceSpecifier, @@ -387,7 +419,6 @@ export default util.createRule({ const typeNamedSpecifiersTexts: string[] = []; const removeTypeNamedSpecifiers: TSESLint.RuleFix[] = []; if (typeNamedSpecifiers.length === allNamedSpecifiers.length) { - // e.g. // import Foo, {Type1, Type2} from 'foo' // import DefType, {Type1, Type2} from 'foo' const openingBraceToken = util.nullThrows( @@ -496,7 +527,7 @@ export default util.createRule({ * import type { Already, Type1, Type2 } from 'foo' * ^^^^^^^^^^^^^ insert */ - function insertToNamedImport( + function fixInsertNamedSpecifiersInNamedSpecifierList( fixer: TSESLint.RuleFixer, target: TSESTree.ImportDeclaration, insertText: string, @@ -511,12 +542,12 @@ export default util.createRule({ ); const before = sourceCode.getTokenBefore(closingBraceToken)!; if (!util.isCommaToken(before) && !util.isOpeningBraceToken(before)) { - insertText = ',' + insertText; + insertText = `,${insertText}`; } - return fixer.insertTextBefore(closingBraceToken, insertText); + return fixer.insertTextBefore(closingBraceToken, `${insertText}`); } - function* fixToTypeImport( + function* fixToTypeImportDeclaration( fixer: TSESLint.RuleFixer, report: ReportValueImport, sourceImports: SourceImports, @@ -527,9 +558,8 @@ export default util.createRule({ classifySpecifier(node); if (namespaceSpecifier && !defaultSpecifier) { - // e.g. // import * as types from 'foo' - yield* fixToTypeImportByInsertType(fixer, node, false); + yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false); return; } else if (defaultSpecifier) { if ( @@ -537,9 +567,8 @@ export default util.createRule({ namedSpecifiers.length === 0 && !namespaceSpecifier ) { - // e.g. // import Type from 'foo' - yield* fixToTypeImportByInsertType(fixer, node, true); + yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, true); return; } } else { @@ -549,9 +578,8 @@ export default util.createRule({ ) && !namespaceSpecifier ) { - // e.g. // import {Type1, Type2} from 'foo' - yield* fixToTypeImportByInsertType(fixer, node, false); + yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false); return; } } @@ -569,11 +597,12 @@ export default util.createRule({ const afterFixes: TSESLint.RuleFix[] = []; if (typeNamedSpecifiers.length) { if (sourceImports.typeOnlyNamedImport) { - const insertTypeNamedSpecifiers = insertToNamedImport( - fixer, - sourceImports.typeOnlyNamedImport, - fixesNamedSpecifiers.typeNamedSpecifiersText, - ); + const insertTypeNamedSpecifiers = + fixInsertNamedSpecifiersInNamedSpecifierList( + fixer, + sourceImports.typeOnlyNamedImport, + fixesNamedSpecifiers.typeNamedSpecifiersText, + ); if (sourceImports.typeOnlyNamedImport.range[1] <= node.range[0]) { yield insertTypeNamedSpecifiers; } else { @@ -594,7 +623,6 @@ export default util.createRule({ namespaceSpecifier && report.typeSpecifiers.includes(namespaceSpecifier) ) { - // e.g. // import Foo, * as Type from 'foo' // import DefType, * as Type from 'foo' // import DefType, * as Type from 'foo' @@ -665,7 +693,7 @@ export default util.createRule({ yield* afterFixes; } - function* fixToTypeImportByInsertType( + function* fixInsertTypeSpecifierForImportDeclaration( fixer: TSESLint.RuleFixer, node: TSESTree.ImportDeclaration, isDefaultImport: boolean, @@ -722,9 +750,19 @@ export default util.createRule({ } } } + + // make sure we don't do anything like `import type {type T} from 'foo';` + for (const specifier of node.specifiers) { + if ( + specifier.type === AST_NODE_TYPES.ImportSpecifier && + specifier.importKind === 'type' + ) { + yield* fixRemoveTypeSpecifierFromImportSpecifier(fixer, specifier); + } + } } - function* fixToValueImportInDecoMeta( + function* fixToValueImportDeclaration( fixer: TSESLint.RuleFixer, report: ReportValueImport, sourceImports: SourceImports, @@ -735,18 +773,16 @@ export default util.createRule({ classifySpecifier(node); if (namespaceSpecifier) { - // e.g. // import type * as types from 'foo' - yield* fixToValueImport(fixer, node); + yield* fixRemoveTypeSpecifierFromImportDeclaration(fixer, node); return; } else if (defaultSpecifier) { if ( report.valueSpecifiers.includes(defaultSpecifier) && namedSpecifiers.length === 0 ) { - // e.g. // import type Type from 'foo' - yield* fixToValueImport(fixer, node); + yield* fixRemoveTypeSpecifierFromImportDeclaration(fixer, node); return; } } else { @@ -755,9 +791,8 @@ export default util.createRule({ report.valueSpecifiers.includes(specifier), ) ) { - // e.g. // import type {Type1, Type2} from 'foo' - yield* fixToValueImport(fixer, node); + yield* fixRemoveTypeSpecifierFromImportDeclaration(fixer, node); return; } } @@ -775,11 +810,12 @@ export default util.createRule({ const afterFixes: TSESLint.RuleFix[] = []; if (valueNamedSpecifiers.length) { if (sourceImports.valueOnlyNamedImport) { - const insertTypeNamedSpecifiers = insertToNamedImport( - fixer, - sourceImports.valueOnlyNamedImport, - fixesNamedSpecifiers.typeNamedSpecifiersText, - ); + const insertTypeNamedSpecifiers = + fixInsertNamedSpecifiersInNamedSpecifierList( + fixer, + sourceImports.valueOnlyNamedImport, + fixesNamedSpecifiers.typeNamedSpecifiersText, + ); if (sourceImports.valueOnlyNamedImport.range[1] <= node.range[0]) { yield insertTypeNamedSpecifiers; } else { @@ -800,7 +836,7 @@ export default util.createRule({ yield* afterFixes; } - function* fixToValueImport( + function* fixRemoveTypeSpecifierFromImportDeclaration( fixer: TSESLint.RuleFixer, node: TSESTree.ImportDeclaration, ): IterableIterator { @@ -824,5 +860,20 @@ export default util.createRule({ ); yield fixer.removeRange([typeToken.range[0], afterToken.range[0]]); } + + function* fixRemoveTypeSpecifierFromImportSpecifier( + fixer: TSESLint.RuleFixer, + node: TSESTree.ImportSpecifier, + ): IterableIterator { + const typeToken = util.nullThrows( + sourceCode.getFirstToken(node, isTypeToken), + util.NullThrowsReasons.MissingToken('type', node.type), + ); + const afterToken = util.nullThrows( + sourceCode.getTokenAfter(typeToken, { includeComments: true }), + util.NullThrowsReasons.MissingToken('any token', node.type), + ); + yield fixer.removeRange([typeToken.range[0], afterToken.range[0]]); + } }, }); diff --git a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts index 07005180ce07..cc841bcdfa57 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts @@ -114,6 +114,11 @@ ruleTester.run('consistent-type-imports', rule, { `, options: [{ prefer: 'no-type-imports' }], }, + ` + import { type A, B } from 'foo'; + type T = A; + const b = B; + `, // exports ` import Type from 'foo'; @@ -1517,5 +1522,45 @@ const a: Default = ''; ], parserOptions: withMetaParserOptions, }, + { + code: ` +import { type A, B } from 'foo'; +type T = A; +const b = B; + `, + output: ` +import { A, B } from 'foo'; +type T = A; +const b = B; + `, + options: [{ prefer: 'no-type-imports' }], + errors: [ + { + messageId: 'valueOverType', + line: 2, + }, + ], + }, + { + code: ` +import { A, B, type C } from 'foo'; +type T = A | C; +const b = B; + `, + output: noFormat` +import type { A} from 'foo'; +import { B, type C } from 'foo'; +type T = A | C; +const b = B; + `, + options: [{ prefer: 'type-imports' }], + errors: [ + { + messageId: 'aImportIsOnlyTypes', + data: { typeImports: '"A"' }, + line: 2, + }, + ], + }, ], }); From 2306acaccb10eaffc7ef146d5ba0ae8162d41986 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Tue, 7 Dec 2021 01:06:05 +0700 Subject: [PATCH 04/19] docs(eslint-plugin): Mention `useUnknownInCatchVariables` in `no-implicit-any-catch` (#4252) --- packages/eslint-plugin/docs/rules/no-implicit-any-catch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md index f9dd35695c17..a03adc818197 100644 --- a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md +++ b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md @@ -4,7 +4,7 @@ TypeScript 4.0 added support for adding an explicit `any` or `unknown` type anno By default, TypeScript will type a catch clause variable as `any`, so explicitly annotating it as `unknown` can add a lot of safety to your codebase. -The `noImplicitAny` flag in TypeScript does not cover this for backwards compatibility reasons. +The `noImplicitAny` flag in TypeScript does not cover this for backwards compatibility reasons, however you can use `useUnknownInCatchVariables` (part of `strict`) instead of this rule. ## Rule Details From 9aae7d3735e2abf916907b60dee4404912152ea9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:14:14 -0800 Subject: [PATCH 05/19] chore: bump @microsoft/api-extractor from 7.18.19 to 7.18.21 (#4262) Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-extractor) from 7.18.19 to 7.18.21. - [Release notes](https://github.com/microsoft/rushstack/releases) - [Changelog](https://github.com/microsoft/rushstack/blob/master/apps/api-extractor/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-extractor_v7.18.21/apps/api-extractor) --- updated-dependencies: - dependency-name: "@microsoft/api-extractor" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/yarn.lock b/yarn.lock index 889f67f81324..48da18776402 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2916,26 +2916,26 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@microsoft/api-extractor-model@7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.13.16.tgz#1d67541ebbcea32672c5fdd9392dc1579b2fc23a" - integrity sha512-ttdxVXsTWL5dd26W1YNLe3LgDsE0EE273aZlcLe58W0opymBybCYU1Mn+OHQM8BuErrdvdN8LdpWAAbkiOEN/Q== +"@microsoft/api-extractor-model@7.13.18": + version "7.13.18" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.13.18.tgz#f60f037c4ae3678924145b4321bb97d0939b0b30" + integrity sha512-Oo9hhidRk9bFa17xkdNWso0Ry/wW6jlxD+5N2ilk1CnvZ50s6SLbZpFQJmVownM2tkHc1REdyEeQSyoApSB6Hw== dependencies: "@microsoft/tsdoc" "0.13.2" "@microsoft/tsdoc-config" "~0.15.2" - "@rushstack/node-core-library" "3.43.2" + "@rushstack/node-core-library" "3.44.1" "@microsoft/api-extractor@^7.18.16": - version "7.18.19" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.18.19.tgz#f09afc1c210aa67e2f3f34b0a68281a12f144541" - integrity sha512-aY+/XR7PtQXtnqNPFRs3/+iVRlQJpo6uLTjO2g7PqmnMywl3GBU3bCgAlV/khZtAQbIs6Le57XxmSE6rOqbcfg== + version "7.18.21" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.18.21.tgz#6a6d151b764c2f30d51097cd3da33ca42efd01f6" + integrity sha512-jRtT4ZPCUOVYlNjxsszXJQdXFu8lmdkSz8wZNVQzBkBFh5kn8Ej66p8b/KecQKpVnzUcTgPOKr1RcWR+0Fmgew== dependencies: - "@microsoft/api-extractor-model" "7.13.16" + "@microsoft/api-extractor-model" "7.13.18" "@microsoft/tsdoc" "0.13.2" "@microsoft/tsdoc-config" "~0.15.2" - "@rushstack/node-core-library" "3.43.2" - "@rushstack/rig-package" "0.3.5" - "@rushstack/ts-command-line" "4.10.4" + "@rushstack/node-core-library" "3.44.1" + "@rushstack/rig-package" "0.3.6" + "@rushstack/ts-command-line" "4.10.5" colors "~1.2.1" lodash "~4.17.15" resolve "~1.17.0" @@ -3317,10 +3317,10 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@rushstack/node-core-library@3.43.2": - version "3.43.2" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.43.2.tgz#f067371a94fd92ed8f9d9aa8201c5e9e17a19f0f" - integrity sha512-b7AEhSf6CvZgvuDcWMFDeKx2mQSn9AVnMQVyxNxFeHCtLz3gJicqCOlw2GOXM8HKh6PInLdil/NVCDcstwSrIw== +"@rushstack/node-core-library@3.44.1": + version "3.44.1" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.44.1.tgz#5a66016e227e3227ded3fe798aa6045f6c9f9a28" + integrity sha512-qK2BKuRoy6Vh83qjXxilafsUJ1soXzEX0rtkxmAC+GsKOdEVav74Df5859bvY2Ap0JNnYfGfXukX/8o3vqODyw== dependencies: "@types/node" "12.20.24" colors "~1.2.1" @@ -3332,18 +3332,18 @@ timsort "~0.3.0" z-schema "~3.18.3" -"@rushstack/rig-package@0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.5.tgz#7ddab0994647837bab8fdef26f990f1774d82e78" - integrity sha512-CvqWw+E81U5lRBN/lUj7Ngr/XQa/PPb2jAS5QcLP7WL+IMUl+3+Cc2qYrsDoB4zke81kz+usWGmBQpBzGMLmAA== +"@rushstack/rig-package@0.3.6": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.6.tgz#a57b53db59106fb93bcda36cad4f8602f508ebc6" + integrity sha512-H/uFsAT6cD4JCYrlQXYMZg+wPVECByFoJLGqfGRiTwSS5ngQw9QxnFV2mPG2LrxFUsMjLQ2lsrYr523700XzfA== dependencies: resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/ts-command-line@4.10.4": - version "4.10.4" - resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.10.4.tgz#05142b74e5cb207d3dd9b935c82f80d7fcb68042" - integrity sha512-4T5ao4UgDb6LmiRj4GumvG3VT/p6RSMgl7TN7S58ifaAGN2GeTNBajFCDdJs9QQP0d/4tA5p0SFzT7Ps5Byirg== +"@rushstack/ts-command-line@4.10.5": + version "4.10.5" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.10.5.tgz#a31a44ddd24fe3a594e4ad91c22f3ea7668b43a9" + integrity sha512-5fVlTDbKsJ5WyT6L7NrnOlLG3uoITKxoqTPP2j0QZEi95kPbVT4+VPZaXXDJtkrao9qrIyig8pLK9WABY1bb3w== dependencies: "@types/argparse" "1.0.38" argparse "~1.0.9" From 77004ca3694cef4526ebdf77e3e87ea4b80db752 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:14:25 -0800 Subject: [PATCH 06/19] chore: bump jest from 27.3.1 to 27.4.3 (#4255) Bumps [jest](https://github.com/facebook/jest) from 27.3.1 to 27.4.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.3.1...v27.4.3) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 666 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 575 insertions(+), 91 deletions(-) diff --git a/yarn.lock b/yarn.lock index 48da18776402..6a965b1072aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2004,35 +2004,47 @@ jest-util "^27.3.1" slash "^3.0.0" -"@jest/core@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.1.tgz#04992ef1b58b17c459afb87ab56d81e63d386925" - integrity sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg== +"@jest/console@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.2.tgz#7a95612d38c007ddb528ee446fe5e5e785e685ce" + integrity sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg== dependencies: - "@jest/console" "^27.3.1" - "@jest/reporters" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^27.4.2" + jest-util "^27.4.2" + slash "^3.0.0" + +"@jest/core@^27.4.3": + version "27.4.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.3.tgz#9b9b34f4e6429a633085f476402aa2e3ce707877" + integrity sha512-V9ms3zSxUHxh1E/ZLAiXF7SLejsdFnjWTFizWotMOWvjho0lW5kSjZymhQSodNW0T0ZMQRiha7f8+NcFVm3hJQ== + dependencies: + "@jest/console" "^27.4.2" + "@jest/reporters" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.3.0" - jest-config "^27.3.1" - jest-haste-map "^27.3.1" - jest-message-util "^27.3.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-resolve-dependencies "^27.3.1" - jest-runner "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" - jest-watcher "^27.3.1" + jest-changed-files "^27.4.2" + jest-config "^27.4.3" + jest-haste-map "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-resolve-dependencies "^27.4.2" + jest-runner "^27.4.3" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" + jest-watcher "^27.4.2" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" @@ -2048,6 +2060,16 @@ "@types/node" "*" jest-mock "^27.3.0" +"@jest/environment@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.2.tgz#03efabce528dbb09bffd3ec7e39bb0f3f7475cc2" + integrity sha512-uSljKxh/rGlHlmhyeG4ZoVK9hOec+EPBkwTHkHKQ2EqDu5K+MaG9uJZ8o1CbRsSdZqSuhXvJCYhBWsORPPg6qw== + dependencies: + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/node" "*" + jest-mock "^27.4.2" + "@jest/fake-timers@^27.3.1": version "27.3.1" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.1.tgz#1fad860ee9b13034762cdb94266e95609dfce641" @@ -2060,6 +2082,18 @@ jest-mock "^27.3.0" jest-util "^27.3.1" +"@jest/fake-timers@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.2.tgz#d217f86c3ba2027bf29e0b731fd0cb761a72d093" + integrity sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg== + dependencies: + "@jest/types" "^27.4.2" + "@sinonjs/fake-timers" "^8.0.1" + "@types/node" "*" + jest-message-util "^27.4.2" + jest-mock "^27.4.2" + jest-util "^27.4.2" + "@jest/globals@^27.3.1": version "27.3.1" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.1.tgz#ce1dfb03d379237a9da6c1b99ecfaca1922a5f9e" @@ -2069,6 +2103,15 @@ "@jest/types" "^27.2.5" expect "^27.3.1" +"@jest/globals@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.2.tgz#56a402c5ebf22eba1d34e900772147f5126ea2d8" + integrity sha512-KkfaHEttlGpXYAQTZHgrESiEPx2q/DKAFLGLFda1uGVrqc17snd3YVPhOxlXOHIzVPs+lQ/SDB2EIvxyGzb3Ew== + dependencies: + "@jest/environment" "^27.4.2" + "@jest/types" "^27.4.2" + expect "^27.4.2" + "@jest/reporters@27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.2.tgz#e2d41cd9f8088676b81b9a9908cb1ba67bdbee78" @@ -2099,16 +2142,16 @@ terminal-link "^2.0.0" v8-to-istanbul "^8.0.0" -"@jest/reporters@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.1.tgz#28b5c1f5789481e23788048fa822ed15486430b9" - integrity sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w== +"@jest/reporters@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.2.tgz#d3860c5d3f668fa1326ab2bf5989f774e5c03f04" + integrity sha512-sp4aqmdBJtjKetEakzDPcZggPcVIF6w9QLkYBbaWDV6e/SIsHnF1S4KtIH91eEc2fp7ep6V/e1xvdfEoho1d2w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -2120,10 +2163,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.3.1" - jest-resolve "^27.3.1" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-haste-map "^27.4.2" + jest-resolve "^27.4.2" + jest-util "^27.4.2" + jest-worker "^27.4.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -2139,6 +2182,15 @@ graceful-fs "^4.2.4" source-map "^0.6.0" +"@jest/source-map@^27.4.0": + version "27.4.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.4.0.tgz#2f0385d0d884fb3e2554e8f71f8fa957af9a74b6" + integrity sha512-Ntjx9jzP26Bvhbm93z/AKcPRj/9wrkI88/gK60glXDx1q+IeI0rf7Lw2c89Ch6ofonB0On/iRDreQuQ6te9pgQ== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.2.4" + source-map "^0.6.0" + "@jest/test-result@27.2.2": version "27.2.2" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.2.tgz#cd4ba1ca9b0521e463bd4b32349ba1842277563b" @@ -2159,7 +2211,17 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.2", "@jest/test-sequencer@^27.3.1": +"@jest/test-result@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.2.tgz#05fd4a5466ec502f3eae0b39dff2b93ea4d5d9ec" + integrity sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA== + dependencies: + "@jest/console" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^27.2.2": version "27.3.1" resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz#4b3bde2dbb05ee74afdae608cf0768e3354683b1" integrity sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA== @@ -2169,6 +2231,16 @@ jest-haste-map "^27.3.1" jest-runtime "^27.3.1" +"@jest/test-sequencer@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.2.tgz#94bb7e5412d59ae2a8a4b8f9925bb16b6dc82b4c" + integrity sha512-HmHp5mlh9f9GyNej5yCS1JZIFfUGnP9+jEOH5zoq5EmsuZeYD+dGULqyvGDPtuzzbyAFJ6R4+z4SS0VvnFwwGQ== + dependencies: + "@jest/test-result" "^27.4.2" + graceful-fs "^4.2.4" + jest-haste-map "^27.4.2" + jest-runtime "^27.4.2" + "@jest/transform@^27.2.2", "@jest/transform@^27.3.1": version "27.3.1" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.1.tgz#ff80eafbeabe811e9025e4b6f452126718455220" @@ -2190,6 +2262,27 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" +"@jest/transform@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.2.tgz#459885e96de2e21fc68b8b371e90aa653966dd0d" + integrity sha512-RTKcPZllfcmLfnlxBya7aypofhdz05+E6QITe55Ex0rxyerkgjmmpMlvVn11V0cP719Ps6WcDYCnDzxnnJUwKg== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^27.4.2" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^27.4.2" + jest-regex-util "^27.4.0" + jest-util "^27.4.2" + micromatch "^4.0.4" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + "@jest/types@^27.1.1", "@jest/types@^27.2.5": version "27.2.5" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" @@ -2201,6 +2294,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" + integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@lerna/add@4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" @@ -4487,7 +4591,7 @@ axobject-query@^2.2.0: resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== -babel-jest@^27.2.2, babel-jest@^27.3.1: +babel-jest@^27.2.2: version "27.3.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.1.tgz#0636a3404c68e07001e434ac4956d82da8a80022" integrity sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ== @@ -4501,6 +4605,20 @@ babel-jest@^27.2.2, babel-jest@^27.3.1: graceful-fs "^4.2.4" slash "^3.0.0" +babel-jest@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.2.tgz#6edf80971045cfd44f3f10b6eda6007d95f62742" + integrity sha512-MADrjb3KBO2eyZCAc6QaJg6RT5u+6oEdDyHO5HEalnpwQ6LrhTsQF2Kj1Wnz2t6UPXIXPk18dSXXOT0wF5yTxA== + dependencies: + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^27.4.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + babel-loader@^8.2.2: version "8.2.3" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.3.tgz#8986b40f1a64cacfcb4b8429320085ef68b1342d" @@ -4561,6 +4679,16 @@ babel-plugin-jest-hoist@^27.2.0: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" +babel-plugin-jest-hoist@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.4.0.tgz#d7831fc0f93573788d80dee7e682482da4c730d6" + integrity sha512-Jcu7qS4OX5kTWBc45Hz7BMmgXuJqRnhatqpUhnzGC3OBYpOmf2tv6jFNwZpwM7wU7MUuv2r9IPS/ZlYOuburVw== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.0.0" + "@types/babel__traverse" "^7.0.6" + babel-plugin-polyfill-corejs2@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz#6ed8e30981b062f8fe6aca8873a37ebcc8cc1c0f" @@ -4611,6 +4739,14 @@ babel-preset-jest@^27.2.0: babel-plugin-jest-hoist "^27.2.0" babel-preset-current-node-syntax "^1.0.0" +babel-preset-jest@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.4.0.tgz#70d0e676a282ccb200fbabd7f415db5fdf393bca" + integrity sha512-NK4jGYpnBvNxcGo7/ZpZJr51jCGT+3bwwpVIDY2oNfTxJJldRtB4VAcYdgp1loDE50ODuTu+yBjpMAswv5tlpg== + dependencies: + babel-plugin-jest-hoist "^27.4.0" + babel-preset-current-node-syntax "^1.0.0" + bail@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" @@ -6208,6 +6344,11 @@ diff-sequences@^27.0.6: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff-sequences@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" + integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -6971,6 +7112,18 @@ expect@^27.3.1: jest-message-util "^27.3.1" jest-regex-util "^27.0.6" +expect@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.2.tgz#4429b0f7e307771d176de9bdf23229b101db6ef6" + integrity sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg== + dependencies: + "@jest/types" "^27.4.2" + ansi-styles "^5.0.0" + jest-get-type "^27.4.0" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" + express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -8828,16 +8981,16 @@ jake@^10.6.1: filelist "^1.0.1" minimatch "^3.0.4" -jest-changed-files@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" - integrity sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg== +jest-changed-files@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.4.2.tgz#da2547ea47c6e6a5f6ed336151bd2075736eb4a5" + integrity sha512-/9x8MjekuzUQoPjDHbBiXbNEBauhrPU2ct7m8TfCg69ywt1y/N+yYwGh3gCpnqUS3klYWDU/lSNgv+JhoD2k1A== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.2, jest-circus@^27.3.1: +jest-circus@^27.2.2: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.1.tgz#1679e74387cbbf0c6a8b42de963250a6469e0797" integrity sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw== @@ -8862,21 +9015,46 @@ jest-circus@^27.2.2, jest-circus@^27.3.1: stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.1.tgz#b576f9d146ba6643ce0a162d782b40152b6b1d16" - integrity sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q== +jest-circus@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.2.tgz#466f482207ca9f323b78416c28f4d1fa7588159a" + integrity sha512-2ePUSru1BGMyzxsMvRfu+tNb+PW60rUyMLJBfw1Nrh5zC8RoTPfF+zbE0JToU31a6ZVe4nnrNKWYRzlghAbL0A== dependencies: - "@jest/core" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + expect "^27.4.2" + is-generator-fn "^2.0.0" + jest-each "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + pretty-format "^27.4.2" + slash "^3.0.0" + stack-utils "^2.0.3" + throat "^6.0.1" + +jest-cli@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.3.tgz#89acba683b9f91c7a5e342e2ea13aa5414836a0d" + integrity sha512-zZSJBXNC/i8UnJPwcKWsqnhGgIF3uoTYP7th32Zej7KNQJdxzOMj+wCfy2Ox3kU7nXErJ36DtYyXDhfiqaiDRw== + dependencies: + "@jest/core" "^27.4.3" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-config "^27.4.3" + jest-util "^27.4.2" + jest-validate "^27.4.2" prompts "^2.0.1" yargs "^16.2.0" @@ -8907,32 +9085,33 @@ jest-config@27.2.2: micromatch "^4.0.4" pretty-format "^27.2.2" -jest-config@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.1.tgz#cb3b7f6aaa8c0a7daad4f2b9573899ca7e09bbad" - integrity sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg== +jest-config@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.3.tgz#7820e08f7526fa3f725423e2f0fa7888ee0ef9c9" + integrity sha512-DQ10HTSqYtC2pO7s9j2jw+li4xUnm2wLYWH2o7K1ftB8NyvToHsXoLlXxtsGh3AW9gUQR6KY/4B7G+T/NswJBw== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.3.1" - "@jest/types" "^27.2.5" - babel-jest "^27.3.1" + "@jest/test-sequencer" "^27.4.2" + "@jest/types" "^27.4.2" + babel-jest "^27.4.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.3.1" - jest-environment-jsdom "^27.3.1" - jest-environment-node "^27.3.1" - jest-get-type "^27.3.1" - jest-jasmine2 "^27.3.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-runner "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-circus "^27.4.2" + jest-environment-jsdom "^27.4.3" + jest-environment-node "^27.4.2" + jest-get-type "^27.4.0" + jest-jasmine2 "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-runner "^27.4.3" + jest-util "^27.4.2" + jest-validate "^27.4.2" micromatch "^4.0.4" - pretty-format "^27.3.1" + pretty-format "^27.4.2" + slash "^3.0.0" jest-diff@^27.0.0, jest-diff@^27.3.1: version "27.3.1" @@ -8944,6 +9123,16 @@ jest-diff@^27.0.0, jest-diff@^27.3.1: jest-get-type "^27.3.1" pretty-format "^27.3.1" +jest-diff@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" + integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.4.0" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" + jest-docblock@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" @@ -8951,6 +9140,13 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" +jest-docblock@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.4.0.tgz#06c78035ca93cbbb84faf8fce64deae79a59f69f" + integrity sha512-7TBazUdCKGV7svZ+gh7C8esAnweJoG+SvcF6Cjqj4l17zA2q1cMwx2JObSioubk317H+cjcHgP+7fTs60paulg== + dependencies: + detect-newline "^3.0.0" + jest-each@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.1.tgz#14c56bb4f18dd18dc6bdd853919b5f16a17761ff" @@ -8962,6 +9158,17 @@ jest-each@^27.3.1: jest-util "^27.3.1" pretty-format "^27.3.1" +jest-each@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.2.tgz#19364c82a692d0d26557642098d1f4619c9ee7d3" + integrity sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg== + dependencies: + "@jest/types" "^27.4.2" + chalk "^4.0.0" + jest-get-type "^27.4.0" + jest-util "^27.4.2" + pretty-format "^27.4.2" + jest-environment-jsdom@^27.2.2, jest-environment-jsdom@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz#63ac36d68f7a9303494df783494856222b57f73e" @@ -8975,6 +9182,19 @@ jest-environment-jsdom@^27.2.2, jest-environment-jsdom@^27.3.1: jest-util "^27.3.1" jsdom "^16.6.0" +jest-environment-jsdom@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.3.tgz#74198285f6284888ca9c7486c4e5e67add75aa53" + integrity sha512-x1AUVz3G14LpEJs7KIFUaTINT2n0unOUmvdAby3s/sldUpJJetOJifHo1O/EUQC5fNBowggwJbVulko18y6OWw== + dependencies: + "@jest/environment" "^27.4.2" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/node" "*" + jest-mock "^27.4.2" + jest-util "^27.4.2" + jsdom "^16.6.0" + jest-environment-node@^27.2.2, jest-environment-node@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.1.tgz#af7d0eed04edafb740311b303f3fe7c8c27014bb" @@ -8987,11 +9207,28 @@ jest-environment-node@^27.2.2, jest-environment-node@^27.3.1: jest-mock "^27.3.0" jest-util "^27.3.1" +jest-environment-node@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.2.tgz#bf5586a0924a8d21c13838121ac0941638c7d15e" + integrity sha512-nzTZ5nJ+FabuZPH2YVci7SZIHpvtNRHPt8+vipLkCnAgXGjVzHm7XJWdnNqXbAkExIgiKeVEkVMNZOZE/LeiIg== + dependencies: + "@jest/environment" "^27.4.2" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/node" "*" + jest-mock "^27.4.2" + jest-util "^27.4.2" + jest-get-type@^27.0.6, jest-get-type@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== +jest-get-type@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" + integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== + jest-haste-map@^27.2.2, jest-haste-map@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.1.tgz#7656fbd64bf48bda904e759fc9d93e2c807353ee" @@ -9012,7 +9249,27 @@ jest-haste-map@^27.2.2, jest-haste-map@^27.3.1: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.2, jest-jasmine2@^27.3.1: +jest-haste-map@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.2.tgz#7fc7d5e568cca704284f4850885b74a0b8b87587" + integrity sha512-foiyAEePORUN2eeJnOtcM1y8qW0ShEd9kTjWVL4sVaMcuCJM6gtHegvYPBRT0mpI/bs4ueThM90+Eoj2ncoNsA== + dependencies: + "@jest/types" "^27.4.2" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^27.4.0" + jest-serializer "^27.4.0" + jest-util "^27.4.2" + jest-worker "^27.4.2" + micromatch "^4.0.4" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + +jest-jasmine2@^27.2.2: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz#df6d3d07c7dafc344feb43a0072a6f09458d32b0" integrity sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg== @@ -9036,6 +9293,30 @@ jest-jasmine2@^27.2.2, jest-jasmine2@^27.3.1: pretty-format "^27.3.1" throat "^6.0.1" +jest-jasmine2@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.2.tgz#c956c88b9c05ca22afdc779deebc2890cb891797" + integrity sha512-VO/fyAJSH9u0THjbteFiL8qc93ufU+yW+bdieDc8tzTCWwlWzO53UHS5nFK1qmE8izb5Smkn+XHlVt6/l06MKQ== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^27.4.2" + "@jest/source-map" "^27.4.0" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + expect "^27.4.2" + is-generator-fn "^2.0.0" + jest-each "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + pretty-format "^27.4.2" + throat "^6.0.1" + jest-leak-detector@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz#7fb632c2992ef707a1e73286e1e704f9cc1772b2" @@ -9044,6 +9325,14 @@ jest-leak-detector@^27.3.1: jest-get-type "^27.3.1" pretty-format "^27.3.1" +jest-leak-detector@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz#7fc3120893a7a911c553f3f2bdff9faa4454abbb" + integrity sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw== + dependencies: + jest-get-type "^27.4.0" + pretty-format "^27.4.2" + jest-matcher-utils@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz#257ad61e54a6d4044e080d85dbdc4a08811e9c1c" @@ -9054,6 +9343,16 @@ jest-matcher-utils@^27.3.1: jest-get-type "^27.3.1" pretty-format "^27.3.1" +jest-matcher-utils@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz#d17c5038607978a255e0a9a5c32c24e984b6c60b" + integrity sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ== + dependencies: + chalk "^4.0.0" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" + jest-message-util@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.1.tgz#f7c25688ad3410ab10bcb862bcfe3152345c6436" @@ -9069,6 +9368,21 @@ jest-message-util@^27.3.1: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.2.tgz#07f3f1bf207d69cf798ce830cc57f1a849f99388" + integrity sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.4.2" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.4" + pretty-format "^27.4.2" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^27.3.0: version "27.3.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.3.0.tgz#ddf0ec3cc3e68c8ccd489bef4d1f525571a1b867" @@ -9077,6 +9391,14 @@ jest-mock@^27.3.0: "@jest/types" "^27.2.5" "@types/node" "*" +jest-mock@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.2.tgz#184ff197a25491bfe4570c286daa5d62eb760b88" + integrity sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA== + dependencies: + "@jest/types" "^27.4.2" + "@types/node" "*" + jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" @@ -9087,14 +9409,19 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz#85b99bdbdfa46e2c81c6228fc4c91076f624f6e2" - integrity sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A== +jest-regex-util@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" + integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== + +jest-resolve-dependencies@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.2.tgz#2f4f363cca26f75a22aefd496f9c7ae65b3de37f" + integrity sha512-hb++cTpqvOWfU49MCP/JQkxmnrhKoAVqXWFjgYXswRSVGk8Q6bDTSvhbCeYXDtXaymY0y7WrrSIlKogClcKJuw== dependencies: - "@jest/types" "^27.2.5" - jest-regex-util "^27.0.6" - jest-snapshot "^27.3.1" + "@jest/types" "^27.4.2" + jest-regex-util "^27.4.0" + jest-snapshot "^27.4.2" jest-resolve@27.2.2: version "27.2.2" @@ -9128,7 +9455,23 @@ jest-resolve@^27.2.2, jest-resolve@^27.3.1: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.2.2, jest-runner@^27.3.1: +jest-resolve@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.2.tgz#d3e4cbee7acb4a4f8c8bfc270767bec34d2aefaf" + integrity sha512-d/zqPjxCzMqHlOdRTg8cTpO9jY+1/T74KazT8Ws/LwmwxV5sRMWOkiLjmzUCDj/5IqA5XHNK4Hkmlq9Kdpb9Sg== + dependencies: + "@jest/types" "^27.4.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^27.4.2" + jest-pnp-resolver "^1.2.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" + resolve "^1.20.0" + resolve.exports "^1.1.0" + slash "^3.0.0" + +jest-runner@^27.2.2: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.1.tgz#1d594dcbf3bd8600a7e839e790384559eaf96e3e" integrity sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww== @@ -9156,6 +9499,34 @@ jest-runner@^27.2.2, jest-runner@^27.3.1: source-map-support "^0.5.6" throat "^6.0.1" +jest-runner@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.3.tgz#9f05d4733829787778e8a143ade913834d0828dc" + integrity sha512-JgR6Om/j22Fd6ZUUIGTWNcCtuZVYbNrecb4k89W4UyFJoRtHpo2zMKWkmFFFJoqwWGrfrcPLnVBIgkJiTV3cyA== + dependencies: + "@jest/console" "^27.4.2" + "@jest/environment" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.8.1" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-docblock "^27.4.0" + jest-environment-jsdom "^27.4.3" + jest-environment-node "^27.4.2" + jest-haste-map "^27.4.2" + jest-leak-detector "^27.4.2" + jest-message-util "^27.4.2" + jest-resolve "^27.4.2" + jest-runtime "^27.4.2" + jest-util "^27.4.2" + jest-worker "^27.4.2" + source-map-support "^0.5.6" + throat "^6.0.1" + jest-runtime@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.1.tgz#80fa32eb85fe5af575865ddf379874777ee993d7" @@ -9188,6 +9559,38 @@ jest-runtime@^27.3.1: strip-bom "^4.0.0" yargs "^16.2.0" +jest-runtime@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.2.tgz#d72da8a0e97366c16ad515a2c437191a72600d38" + integrity sha512-eqPgcBaUNaw6j8T5M+dnfAEh6MIrh2YmtskCr9sl50QYpD22Sg+QqHw3J3nmaLzVMbBtOMHFFxLF0Qx8MsZVFQ== + dependencies: + "@jest/console" "^27.4.2" + "@jest/environment" "^27.4.2" + "@jest/globals" "^27.4.2" + "@jest/source-map" "^27.4.0" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + execa "^5.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.4" + jest-haste-map "^27.4.2" + jest-message-util "^27.4.2" + jest-mock "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^16.2.0" + jest-serializer@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" @@ -9196,6 +9599,14 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" +jest-serializer@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.4.0.tgz#34866586e1cae2388b7d12ffa2c7819edef5958a" + integrity sha512-RDhpcn5f1JYTX2pvJAGDcnsNTnsV9bjYPU8xcV+xPwOXnUPOQwf4ZEuiU6G9H1UztH+OapMgu/ckEVwO87PwnQ== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + jest-snapshot@^27.0.2, jest-snapshot@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.1.tgz#1da5c0712a252d70917d46c037054f5918c49ee4" @@ -9226,6 +9637,36 @@ jest-snapshot@^27.0.2, jest-snapshot@^27.3.1: pretty-format "^27.3.1" semver "^7.3.2" +jest-snapshot@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.2.tgz#bd1ea04a8fab402e5ab18b788809fa597ddff532" + integrity sha512-DI7lJlNIu6WSQ+esqhnJzEzU70+dV+cNjoF1c+j5FagWEd3KtOyZvVliAH0RWNQ6KSnAAnKSU0qxJ8UXOOhuUQ== + dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/parser" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.0.0" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^27.4.2" + graceful-fs "^4.2.4" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + jest-haste-map "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-resolve "^27.4.2" + jest-util "^27.4.2" + natural-compare "^1.4.0" + pretty-format "^27.4.2" + semver "^7.3.2" + jest-specific-snapshot@*, jest-specific-snapshot@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-5.0.0.tgz#48f72d5613af7f3e30df75b6b3534db6bab32ea0" @@ -9257,6 +9698,18 @@ jest-util@^27.0.0, jest-util@^27.2.0, jest-util@^27.3.1: graceful-fs "^4.2.4" picomatch "^2.2.3" +jest-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.4.2.tgz#ed95b05b1adfd761e2cda47e0144c6a58e05a621" + integrity sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA== + dependencies: + "@jest/types" "^27.4.2" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.4" + picomatch "^2.2.3" + jest-validate@^27.2.2, jest-validate@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.1.tgz#3a395d61a19cd13ae9054af8cdaf299116ef8a24" @@ -9269,17 +9722,29 @@ jest-validate@^27.2.2, jest-validate@^27.3.1: leven "^3.1.0" pretty-format "^27.3.1" -jest-watcher@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.1.tgz#ba5e0bc6aa843612b54ddb7f009d1cbff7e05f3e" - integrity sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA== +jest-validate@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.2.tgz#eecfcc1b1c9429aa007da08a2bae4e32a81bbbc3" + integrity sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A== dependencies: - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^27.4.0" + leven "^3.1.0" + pretty-format "^27.4.2" + +jest-watcher@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.2.tgz#c9037edfd80354c9fe90de4b6f8b6e2b8e736744" + integrity sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg== + dependencies: + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.3.1" + jest-util "^27.4.2" string-length "^4.0.1" jest-worker@^27.0.2, jest-worker@^27.0.6, jest-worker@^27.2.2, jest-worker@^27.3.1: @@ -9291,14 +9756,23 @@ jest-worker@^27.0.2, jest-worker@^27.0.6, jest-worker@^27.2.2, jest-worker@^27.3 merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.2.tgz#0fb123d50955af1a450267787f340a1bf7e12bc4" + integrity sha512-0QMy/zPovLfUPyHuOuuU4E+kGACXXE84nRnq6lBVI9GJg5DCBiA97SATi+ZP8CpiJwEQy1oCPjRBf8AnLjN+Ag== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.1.tgz#b5bab64e8f56b6f7e275ba1836898b0d9f1e5c8a" - integrity sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng== + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.3.tgz#cf7d1876a84c70efece2e01e4f9dfc2e464d9cbb" + integrity sha512-jwsfVABBzuN3Atm+6h6vIEpTs9+VApODLt4dk2qv1WMOpb1weI1IIZfuwpMiWZ62qvWj78MvdvMHIYdUfqrFaA== dependencies: - "@jest/core" "^27.3.1" + "@jest/core" "^27.4.3" import-local "^3.0.2" - jest-cli "^27.3.1" + jest-cli "^27.4.3" jju@~1.4.0: version "1.4.0" @@ -11729,6 +12203,16 @@ pretty-format@*, pretty-format@^27.0.0, pretty-format@^27.2.2, pretty-format@^27 ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" + integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== + dependencies: + "@jest/types" "^27.4.2" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-time@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pretty-time/-/pretty-time-1.1.0.tgz#ffb7429afabb8535c346a34e41873adf3d74dd0e" From d8b3b29672bf370e29e0d4e84e25c2c67512dead Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:14:33 -0800 Subject: [PATCH 07/19] chore: bump rollup from 2.60.1 to 2.60.2 (#4257) Bumps [rollup](https://github.com/rollup/rollup) from 2.60.1 to 2.60.2. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.60.1...v2.60.2) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6a965b1072aa..d16af0054a3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13126,9 +13126,9 @@ rimraf@^2.6.3: glob "^7.1.3" rollup@^2.59.0: - version "2.60.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.60.1.tgz#4b34cd247f09b421f10a3c9286eda2ecf9972079" - integrity sha512-akwfnpjY0rXEDSn1UTVfKXJhPsEBu+imi1gqBA1ZkHGydUnkV/fWCC90P7rDaLEW8KTwBcS1G3N4893Ndz+jwg== + version "2.60.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.60.2.tgz#3f45ace36a9b10b4297181831ea0719922513463" + integrity sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw== optionalDependencies: fsevents "~2.3.2" From 7103b3d6845e3d9145d505891019018456455603 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:14:40 -0800 Subject: [PATCH 08/19] chore: bump ts-jest from 27.0.7 to 27.1.0 (#4254) Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.0.7 to 27.1.0. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.0.7...v27.1.0) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d16af0054a3e..4adaba9fd42d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6695,6 +6695,114 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +esbuild-android-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.2.tgz#256b7cf2f9d382a2a92a4ff4e13187587c9b7c6a" + integrity sha512-hEixaKMN3XXCkoe+0WcexO4CcBVU5DCSUT+7P8JZiWZCbAjSkc9b6Yz2X5DSfQmRCtI/cQRU6TfMYrMQ5NBfdw== + +esbuild-darwin-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.2.tgz#891a59ce6bc3aded0265f982469b3eb9571b92f8" + integrity sha512-Uq8t0cbJQkxkQdbUfOl2wZqZ/AtLZjvJulR1HHnc96UgyzG9YlCLSDMiqjM+NANEy7/zzvwKJsy3iNC9wwqLJA== + +esbuild-darwin-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.2.tgz#ab834fffa9c612b2901ca1e77e4695d4d8aa63a2" + integrity sha512-619MSa17sr7YCIrUj88KzQu2ESA4jKYtIYfLU/smX6qNgxQt3Y/gzM4s6sgJ4fPQzirvmXgcHv1ZNQAs/Xh48A== + +esbuild-freebsd-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.2.tgz#f7fc87a83f02de27d5a48472571efa1a432ae86d" + integrity sha512-aP6FE/ZsChZpUV6F3HE3x1Pz0paoYXycJ7oLt06g0G9dhJKknPawXCqQg/WMyD+ldCEZfo7F1kavenPdIT/SGQ== + +esbuild-freebsd-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.2.tgz#bc8758420431106751f3180293cac0b5bc4ce2ee" + integrity sha512-LSm98WTb1QIhyS83+Po0KTpZNdd2XpVpI9ua5rLWqKWbKeNRFwOsjeiuwBaRNc+O32s9oC2ZMefETxHBV6VNkQ== + +esbuild-linux-32@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.2.tgz#0cc2dcd816d6d66e255bc7aeac139b1d04246812" + integrity sha512-8VxnNEyeUbiGflTKcuVc5JEPTqXfsx2O6ABwUbfS1Hp26lYPRPC7pKQK5Dxa0MBejGc50jy7YZae3EGQUQ8EkQ== + +esbuild-linux-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.2.tgz#c790f739aa75b15c153609ea3457153fbe4db93d" + integrity sha512-4bzMS2dNxOJoFIiHId4w+tqQzdnsch71JJV1qZnbnErSFWcR9lRgpSqWnTTFtv6XM+MvltRzSXC5wQ7AEBY6Hg== + +esbuild-linux-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.2.tgz#96858a1f89ad30274dec780d0e3dd8b5691c6b0c" + integrity sha512-RlIVp0RwJrdtasDF1vTFueLYZ8WuFzxoQ1OoRFZOTyJHCGCNgh7xJIC34gd7B7+RT0CzLBB4LcM5n0LS+hIoww== + +esbuild-linux-arm@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.2.tgz#03e193225afa9b1215d2ec6efe8edf0c03eeed6f" + integrity sha512-PaylahvMHhH8YMfJPMKEqi64qA0Su+d4FNfHKvlKes/2dUe4QxgbwXT9oLVgy8iJdcFMrO7By4R8fS8S0p8aVQ== + +esbuild-linux-mips64le@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.2.tgz#972f218d2cb5125237376d40ad60a6e5356a782c" + integrity sha512-Fdwrq2roFnO5oetIiUQQueZ3+5soCxBSJswg3MvYaXDomj47BN6oAWMZgLrFh1oVrtWrxSDLCJBenYdbm2s+qQ== + +esbuild-linux-ppc64le@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.2.tgz#20b71622ac09142b0e523f633af0829def7fed6b" + integrity sha512-vxptskw8JfCDD9QqpRO0XnsM1osuWeRjPaXX1TwdveLogYsbdFtcuiuK/4FxGiNMUr1ojtnCS2rMPbY8puc5NA== + +esbuild-netbsd-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.2.tgz#dbd6a25117902ef67aa11d8779dd9c6bca7fbe82" + integrity sha512-I8+LzYK5iSNpspS9eCV9sW67Rj8FgMHimGri4mKiGAmN0pNfx+hFX146rYtzGtewuxKtTsPywWteHx+hPRLDsw== + +esbuild-openbsd-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.2.tgz#3c5f199eed459b2f88865548394c0b77383d9ca4" + integrity sha512-120HgMe9elidWUvM2E6mMf0csrGwx8sYDqUIJugyMy1oHm+/nT08bTAVXuwYG/rkMIqsEO9AlMxuYnwR6En/3Q== + +esbuild-sunos-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.2.tgz#900a681db6b76c6a7f60fc28d2bfe5b11698641c" + integrity sha512-Q3xcf9Uyfra9UuCFxoLixVvdigo0daZaKJ97TL2KNA4bxRUPK18wwGUk3AxvgDQZpRmg82w9PnkaNYo7a+24ow== + +esbuild-windows-32@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.2.tgz#61e0ba5bd95b277a55d2b997ac4c04dfe2559220" + integrity sha512-TW7O49tPsrq+N1sW8mb3m24j/iDGa4xzAZH4wHWwoIzgtZAYPKC0hpIhufRRG/LA30bdMChO9pjJZ5mtcybtBQ== + +esbuild-windows-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.2.tgz#6ab59ef721ff75c682a1c8ae0570dabb637abddb" + integrity sha512-Rym6ViMNmi1E2QuQMWy0AFAfdY0wGwZD73BnzlsQBX5hZBuy/L+Speh7ucUZ16gwsrMM9v86icZUDrSN/lNBKg== + +esbuild-windows-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.2.tgz#aca2a4f83d2f0d1592ad4be832ed0045fc888cda" + integrity sha512-ZrLbhr0vX5Em/P1faMnHucjVVWPS+m3tktAtz93WkMZLmbRJevhiW1y4CbulBd2z0MEdXZ6emDa1zFHq5O5bSA== + +esbuild@~0.14.0: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.2.tgz#9c1e1a652549cc33e44885eea42ea2cc6267edc2" + integrity sha512-l076A6o/PIgcyM24s0dWmDI/b8RQf41uWoJu9I0M71CtW/YSw5T5NUeXxs5lo2tFQD+O4CW4nBHJXx3OY5NpXg== + optionalDependencies: + esbuild-android-arm64 "0.14.2" + esbuild-darwin-64 "0.14.2" + esbuild-darwin-arm64 "0.14.2" + esbuild-freebsd-64 "0.14.2" + esbuild-freebsd-arm64 "0.14.2" + esbuild-linux-32 "0.14.2" + esbuild-linux-64 "0.14.2" + esbuild-linux-arm "0.14.2" + esbuild-linux-arm64 "0.14.2" + esbuild-linux-mips64le "0.14.2" + esbuild-linux-ppc64le "0.14.2" + esbuild-netbsd-64 "0.14.2" + esbuild-openbsd-64 "0.14.2" + esbuild-sunos-64 "0.14.2" + esbuild-windows-32 "0.14.2" + esbuild-windows-64 "0.14.2" + esbuild-windows-arm64 "0.14.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -14294,11 +14402,12 @@ ts-essentials@^2.0.3: integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== ts-jest@^27.0.5: - version "27.0.7" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.7.tgz#fb7c8c8cb5526ab371bc1b23d06e745652cca2d0" - integrity sha512-O41shibMqzdafpuP+CkrOL7ykbmLh+FqQrXEmV9CydQ5JBk0Sj0uAEF5TNNe94fZWKm3yYvWa/IbyV4Yg1zK2Q== + version "27.1.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.0.tgz#8423cd48a47b4d66700a55702858fa5f9a415df0" + integrity sha512-ZouWlP03JMtzfNHg0ZeDrxAESYGmVhWyHtIl2/01kBbXaMbTr4Vhv6/GeMxUed6GFg/4ycMo+yU6Eo9gI16xTQ== dependencies: bs-logger "0.x" + esbuild "~0.14.0" fast-json-stable-stringify "2.x" jest-util "^27.0.0" json5 "2.x" From 08bf9ae3214c5cdc8e324962a3ee6f5ca8d6d51f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:56:49 -0800 Subject: [PATCH 09/19] chore: bump webpack from 5.64.4 to 5.65.0 (#4266) Bumps [webpack](https://github.com/webpack/webpack) from 5.64.4 to 5.65.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.64.4...v5.65.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4adaba9fd42d..5ad92120fbd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15030,10 +15030,10 @@ walker@^1.0.7: dependencies: makeerror "1.0.x" -watchpack@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.0.tgz#a41bca3da6afaff31e92a433f4c856a0c25ea0c4" - integrity sha512-MnN0Q1OsvB/GGHETrFeZPQaOelWh/7O+EiFlj8sM9GPjtQkis7k01aAxrg/18kTfoIVcLL+haEVFlXDaSRwKRw== +watchpack@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25" + integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -15156,9 +15156,9 @@ webpack-sources@^3.2.2: integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw== webpack@^5.61.0, webpack@^5.64.0: - version "5.64.4" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.64.4.tgz#e1454b6a13009f57cc2c78e08416cd674622937b" - integrity sha512-LWhqfKjCLoYJLKJY8wk2C3h77i8VyHowG3qYNZiIqD6D0ZS40439S/KVuc/PY48jp2yQmy0mhMknq8cys4jFMw== + version "5.65.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be" + integrity sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.50" @@ -15182,7 +15182,7 @@ webpack@^5.61.0, webpack@^5.64.0: schema-utils "^3.1.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.3" - watchpack "^2.3.0" + watchpack "^2.3.1" webpack-sources "^3.2.2" webpackbar@^5.0.0-3: From 832b15a4e3f36fbeb34383af342243d715cf1c6c Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Date: Mon, 6 Dec 2021 13:57:42 -0600 Subject: [PATCH 10/19] docs(website): fix tsconfig.eslint.json instead of .eslintrc.js in code snippet (#4263) --- docs/linting/MONOREPO.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/linting/MONOREPO.md b/docs/linting/MONOREPO.md index c135ae8cafab..2f8cbe15f349 100644 --- a/docs/linting/MONOREPO.md +++ b/docs/linting/MONOREPO.md @@ -56,21 +56,21 @@ If you've only got one, you should inspect the `include` paths. If it doesn't in The former doesn't always work for everyone if they've got a complex build, as adding more paths (like test paths) to `include` could break the build. In those cases we suggest creating a new config called `tsconfig.eslint.json`, that looks something like this: -```js title=".eslintrc.js" -module.exports = { +```jsonc title="tsconfig.eslint.json" +{ // extend your base config to share compilerOptions, etc - extends: './tsconfig.json', - compilerOptions: { + "extends": "./tsconfig.json", + "compilerOptions": { // ensure that nobody can accidentally use this config for a build - noEmit: true, + "noEmit": true }, - include: [ + "include": [ // whatever paths you intend to lint - 'src', - 'test', - 'tools', - ], -}; + "src", + "test", + "tools" + ] +} ``` Ensure you update your `.eslintrc.js` to point at this new config file. From e5c1477bc34dfb5a43323549de1bedd40107c6f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:20:22 -0800 Subject: [PATCH 11/19] chore: bump pretty-format from 27.3.1 to 27.4.2 (#4265) Bumps [pretty-format](https://github.com/facebook/jest/tree/HEAD/packages/pretty-format) from 27.3.1 to 27.4.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v27.4.2/packages/pretty-format) --- updated-dependencies: - dependency-name: pretty-format dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5ad92120fbd6..ce956d731c00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2283,18 +2283,7 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.1.1", "@jest/types@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" - integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - -"@jest/types@^27.4.2": +"@jest/types@^27.1.1", "@jest/types@^27.2.5", "@jest/types@^27.4.2": version "27.4.2" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== @@ -12301,17 +12290,7 @@ pretty-error@^4.0.0: lodash "^4.17.20" renderkid "^3.0.0" -pretty-format@*, pretty-format@^27.0.0, pretty-format@^27.2.2, pretty-format@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" - integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== - dependencies: - "@jest/types" "^27.2.5" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^27.4.2: +pretty-format@*, pretty-format@^27.0.0, pretty-format@^27.2.2, pretty-format@^27.3.1, pretty-format@^27.4.2: version "27.4.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== From 72fa9129e554cc4a79147645fedcefa08a687f94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:20:39 -0800 Subject: [PATCH 12/19] chore: bump @rollup/pluginutils from 3.1.0 to 4.1.1 (#4267) Bumps [@rollup/pluginutils](https://github.com/rollup/plugins/tree/HEAD/packages/pluginutils) from 3.1.0 to 4.1.1. - [Release notes](https://github.com/rollup/plugins/releases) - [Changelog](https://github.com/rollup/plugins/blob/master/packages/pluginutils/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/typescript-v4.1.1/packages/pluginutils) --- updated-dependencies: - dependency-name: "@rollup/pluginutils" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/website-eslint/package.json | 2 +- yarn.lock | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 042aee614edc..70e488faa0eb 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -23,7 +23,7 @@ "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.6", - "@rollup/pluginutils": "^3.1.0", + "@rollup/pluginutils": "^4.1.1", "@typescript-eslint/eslint-plugin": "5.6.0", "@typescript-eslint/parser": "5.6.0", "@typescript-eslint/scope-manager": "5.6.0", diff --git a/yarn.lock b/yarn.lock index ce956d731c00..c3d2b21611a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3410,6 +3410,14 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rollup/pluginutils@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" + integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== + dependencies: + estree-walker "^2.0.1" + picomatch "^2.2.2" + "@rushstack/node-core-library@3.44.1": version "3.44.1" resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.44.1.tgz#5a66016e227e3227ded3fe798aa6045f6c9f9a28" From 550b61ee1096113b234bf035dd267ba385809961 Mon Sep 17 00:00:00 2001 From: Taeheon Kim Date: Wed, 8 Dec 2021 03:49:44 +0900 Subject: [PATCH 13/19] fix(typescript-estree): type-only regression for consumers not yet on TS 4.5 (#4272) --- packages/typescript-estree/src/ts-estree/ts-nodes.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index f750ee21c769..bf5ab185ee15 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -8,6 +8,8 @@ declare module 'typescript' { export interface TemplateLiteralTypeNode extends ts.Node {} export interface PrivateIdentifier extends ts.Node {} export interface ClassStaticBlockDeclaration extends ts.Node {} + export interface AssertClause extends ts.Node {} + export interface AssertEntry extends ts.Node {} /* eslint-enable @typescript-eslint/no-empty-interface */ } From 9c22f6523908bf8f4e023e51ec6e1e0f87b57d1c Mon Sep 17 00:00:00 2001 From: Tobias Smolka <37370256+tosmolka@users.noreply.github.com> Date: Tue, 7 Dec 2021 19:51:33 +0100 Subject: [PATCH 14/19] docs: updates to security rules in ROADMAP.md (#4271) --- packages/eslint-plugin/ROADMAP.md | 74 ++++++++++++++++++------------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 9dfc1952dd82..7dc6efe1c095 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -235,7 +235,6 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- | `function-name` | 🛑 | N/A | | `import-name` | 🛑 | N/A ([relevant plugin][plugin:import]) | | `informative-docs` | 🛑 | N/A | -| `insecure-random` | 🔌 | [custom implementation][insecure-random] | | `max-func-body-length` | 🌟 | [`max-statements`][max-statements] | | `no-banned-terms` | 🌟 | [`no-caller`][no-caller] & [`no-eval`][no-eval] | | `no-constant-condition` | 🌟 | [`no-constant-condition`][no-constant-condition] | @@ -270,39 +269,39 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [4] Recommended config: `["error", { "terms": ["BUG", "HACK", "FIXME", "LATER", "LATER2", "TODO"], "location": "anywhere" }]`
[5] Does not check class fields. -[insecure-random]: https://github.com/desktop/desktop/blob/development/eslint-rules/insecure-random.js - ### Security -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ------------------------------- | :-: | -------------------------------------------------- | -| `no-disable-auto-sanitization` | 🛑 | N/A | -| `no-document-domain` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] | -| `no-http-string` | 🛑 | N/A | -| `no-inner-html` | 🛑 | N/A | -| `no-string-based-set-immediate` | 🛑 | N/A | -| `no-string-based-set-interval` | 🛑 | N/A | -| `no-string-based-set-timeout` | 🛑 | N/A | -| `react-iframe-missing-sandbox` | 🛑 | N/A | -| `react-no-dangerous-html` | 🔌 | [`react/no-danger`] | -| `non-literal-fs-path` | 🔌 | [`security/detect-non-literal-fs-filename`] | -| `non-literal-require` | 🔌 | [`security/detect-non-literal-require`] | -| `possible-timing-attack` | 🔌 | [`security/detect-possible-timing-attacks`] | +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ------------------------------- | :-: | ------------------------------------------------------------------------------------------- | +| `insecure-random` | 🔌 | [`desktop/insecure-random`] or [`@microsoft/sdl/no-insecure-random`] | +| `no-disable-auto-sanitization` | 🔌 | [`@microsoft/sdl/no-msapp-exec-unsafe`] and [`@microsoft/sdl/no-winjs-html-unsafe`] | +| `no-document-domain` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-document-domain`] | +| `no-http-string` | 🔌 | [`@microsoft/sdl/no-insecure-url`] | +| `no-inner-html` | 🔌 | [`@microsoft/sdl/no-inner-html`] and [`@microsoft/sdl/no-html-method`] | +| `no-string-based-set-immediate` | 🌓 | [`@typescript-eslint/no-implied-eval`] | +| `no-string-based-set-interval` | 🌓 | [`@typescript-eslint/no-implied-eval`] | +| `no-string-based-set-timeout` | 🌓 | [`@typescript-eslint/no-implied-eval`] | +| `react-anchor-blank-noopener` | 🔌 | [`react/jsx-no-target-blank`] | +| `react-iframe-missing-sandbox` | 🔌 | [`@microsoft/sdl/react-iframe-missing-sandbox`] | +| `react-no-dangerous-html` | 🔌 | [`react/no-danger`] | +| `non-literal-fs-path` | 🔌 | [`security/detect-non-literal-fs-filename`] | +| `non-literal-require` | 🔌 | [`security/detect-non-literal-require`] | +| `possible-timing-attack` | 🔌 | [`security/detect-possible-timing-attacks`] | ### Browser -| `tslint-microsoft-contrib` rule | | ESLint rule | -| ----------------------------------- | :-: | -------------------------------------------------- | -| `jquery-deferred-must-complete` | 🛑 | N/A | -| `no-backbone-get-set-outside-model` | 🛑 | N/A | -| `no-cookies` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] | -| `no-document-write` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] | -| `no-exec-script` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] | -| `no-jquery-raw-elements` | 🛑 | N/A | -| `no-unsupported-browser-code` | 🛑 | N/A | -| `react-this-binding-issue` | 🛑 | N/A | -| `react-tsx-curly-spacing` | 🔌 | [`react/jsx-curly-spacing`] | -| `react-unused-props-and-state` | 🌓 | [`react/no-unused-state`] | +| `tslint-microsoft-contrib` rule | | ESLint rule | +| ----------------------------------- | :-: | -------------------------------------------------------------------------------------------- | +| `jquery-deferred-must-complete` | 🛑 | N/A | +| `no-backbone-get-set-outside-model` | 🛑 | N/A | +| `no-cookies` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-cookies`] | +| `no-document-write` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@microsoft/sdl/no-document-write`] | +| `no-exec-script` | 🌓 | Use [`no-restricted-syntax`][no-restricted-syntax] or [`@typescript-eslint/no-implied-eval`] | +| `no-jquery-raw-elements` | 🛑 | N/A | +| `no-unsupported-browser-code` | 🛑 | N/A | +| `react-this-binding-issue` | 🛑 | N/A | +| `react-tsx-curly-spacing` | 🔌 | [`react/jsx-curly-spacing`] | +| `react-unused-props-and-state` | 🌓 | [`react/no-unused-state`] | ### React A11y @@ -326,7 +325,6 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- | `react-a11y-role` | 🔌 | [`jsx-a11y/aria-role`] | | `react-a11y-tabindex-no-positive` | 🔌 | [`jsx-a11y/tabindex-no-positive`] | | `react-a11y-titles` | 🛑 | N/A | -| `react-anchor-blank-noopener` | 🛑 | N/A | [1] TSLint rule is more strict
[2] ESLint rule only reports for click handlers @@ -605,6 +603,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/method-signature-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/method-signature-style.md [`@typescript-eslint/no-explicit-any`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-explicit-any.md [`@typescript-eslint/no-empty-interface`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-empty-interface.md +[`@typescript-eslint/no-implied-eval`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-implied-eval.md [`@typescript-eslint/no-inferrable-types`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-inferrable-types.md [`@typescript-eslint/prefer-namespace-keyword`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md [`@typescript-eslint/promise-function-async`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -667,6 +666,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`react/no-danger`]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md [`react/jsx-curly-spacing`]: https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-curly-spacing.md +[`react/jsx-no-target-blank`]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md [`react/no-unused-state`]: https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-state.md @@ -697,6 +697,19 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`jsdoc/require-jsdoc`]: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc [`jsdoc/no-types`]: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types + + +[`@microsoft/sdl/no-cookies`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-cookies.md +[`@microsoft/sdl/no-document-domain`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-document-domain.md +[`@microsoft/sdl/no-document-write`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-document-write.md +[`@microsoft/sdl/no-html-method`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-html-method.md +[`@microsoft/sdl/no-inner-html`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-inner-html.md +[`@microsoft/sdl/no-insecure-random`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-insecure-random.md +[`@microsoft/sdl/no-insecure-url`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-insecure-url.md +[`@microsoft/sdl/no-msapp-exec-unsafe`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-msapp-exec-unsafe.md +[`@microsoft/sdl/no-winjs-html-unsafe`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/no-winjs-html-unsafe.md +[`@microsoft/sdl/react-iframe-missing-sandbox`]: https://github.com/microsoft/eslint-plugin-sdl/blob/main/docs/rules/react-iframe-missing-sandbox.md + [`prefer-arrow/prefer-arrow-functions`]: https://github.com/TristonJ/eslint-plugin-prefer-arrow @@ -710,3 +723,4 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`jsx-a11y/heading-has-content`]: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md [`lodash/chaining`]: https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/chaining.md [`deprecation/deprecation`]: https://github.com/gund/eslint-plugin-deprecation +[`desktop/insecure-random`]: https://github.com/desktop/desktop/blob/development/eslint-rules/insecure-random.js From df1841432b146663d897fbf1ea1e971fce4eeeac Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 9 Dec 2021 05:14:10 +0100 Subject: [PATCH 15/19] chore: update codecov/codecov-action to v2 (#4278) --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ebf7a934156..7af2bdb414ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,9 +137,10 @@ jobs: CI: true - name: Publish code coverage report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} + files: packages/**/coverage/lcov.info flags: unittest name: codecov From f4b64c5bf17cd01b63e3806105d0bf1091ffae70 Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 9 Dec 2021 05:14:35 +0100 Subject: [PATCH 16/19] docs(website): optimize playground config editor (#4242) * docs(website): optimize playground config editor to only trigger lint when needed * docs(website): simplify esc keydown callback * docs(website): add missing aria-label and cleanup styles --- packages/website/package.json | 1 + .../src/components/OptionsSelector.tsx | 35 +++++++++++----- .../src/components/config/ConfigEslint.tsx | 30 +++++++------ .../components/config/ConfigTypeScript.tsx | 20 +++++---- .../src/components/hooks/useHashState.ts | 21 +--------- .../src/components/lib/shallowEqual.ts | 21 ++++++++++ .../src/components/modals/Modal.module.css | 3 +- .../website/src/components/modals/Modal.tsx | 42 +++++++++++++++---- 8 files changed, 112 insertions(+), 61 deletions(-) create mode 100644 packages/website/src/components/lib/shallowEqual.ts diff --git a/packages/website/package.json b/packages/website/package.json index c0941de451e2..ee2a67eb7edd 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -6,6 +6,7 @@ "build": "docusaurus build", "clear": "docusaurus clear", "format": "prettier --write \"./**/*.{md,mdx,ts,js,tsx,jsx}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path ../../.eslintignore", "serve": "docusaurus serve", "start": "docusaurus start", "swizzle": "docusaurus swizzle" diff --git a/packages/website/src/components/OptionsSelector.tsx b/packages/website/src/components/OptionsSelector.tsx index 71f83a95902a..023efce6315d 100644 --- a/packages/website/src/components/OptionsSelector.tsx +++ b/packages/website/src/components/OptionsSelector.tsx @@ -43,19 +43,32 @@ function OptionsSelector({ const [copyLink, setCopyLink] = useState(false); const [copyMarkdown, setCopyMarkdown] = useState(false); - const updateTS = useCallback((version: string) => { - setState({ ts: version }); - }, []); + const updateTS = useCallback( + (version: string) => { + setState({ ts: version }); + }, + [setState], + ); - const updateRules = useCallback((rules: RulesRecord) => { - setState({ rules: rules }); - setEslintModal(false); - }, []); + const updateRules = useCallback( + (rules?: RulesRecord) => { + if (rules) { + setState({ rules: rules }); + } + setEslintModal(false); + }, + [setState], + ); - const updateTsConfig = useCallback((config: CompilerFlags) => { - setState({ tsConfig: config }); - setTypeScriptModal(false); - }, []); + const updateTsConfig = useCallback( + (config?: CompilerFlags) => { + if (config) { + setState({ tsConfig: config }); + } + setTypeScriptModal(false); + }, + [setState], + ); const copyLinkToClipboard = useCallback(async () => { await navigator.clipboard.writeText(document.location.toString()); diff --git a/packages/website/src/components/config/ConfigEslint.tsx b/packages/website/src/components/config/ConfigEslint.tsx index b14baa69983d..cb64ae0a46ad 100644 --- a/packages/website/src/components/config/ConfigEslint.tsx +++ b/packages/website/src/components/config/ConfigEslint.tsx @@ -2,11 +2,12 @@ import React, { useCallback, useEffect, useState } from 'react'; import type { RulesRecord, RuleEntry } from '@typescript-eslint/website-eslint'; import ConfigEditor, { ConfigOptionsType } from './ConfigEditor'; -import { RuleDetails } from '../types'; +import type { RuleDetails } from '../types'; +import { shallowEqual } from '../lib/shallowEqual'; export interface ModalEslintProps { readonly isOpen: boolean; - readonly onClose: (rules: RulesRecord) => void; + readonly onClose: (value?: RulesRecord) => void; readonly ruleOptions: RuleDetails[]; readonly rules: RulesRecord; } @@ -55,19 +56,22 @@ function ConfigEslint(props: ModalEslintProps): JSX.Element { const onClose = useCallback( (newConfig: Record) => { - props.onClose( - Object.fromEntries( - Object.entries(newConfig) - .map<[string, unknown]>(([name, value]) => - Array.isArray(value) && value.length === 1 - ? [name, value[0]] - : [name, value], - ) - .filter(checkOptions), - ), + const cfg = Object.fromEntries( + Object.entries(newConfig) + .map<[string, unknown]>(([name, value]) => + Array.isArray(value) && value.length === 1 + ? [name, value[0]] + : [name, value], + ) + .filter(checkOptions), ); + if (!shallowEqual(cfg, props.rules)) { + props.onClose(cfg); + } else { + props.onClose(); + } }, - [props.onClose], + [props.onClose, props.rules], ); return ( diff --git a/packages/website/src/components/config/ConfigTypeScript.tsx b/packages/website/src/components/config/ConfigTypeScript.tsx index a86f66aff961..27cc2cbdd97b 100644 --- a/packages/website/src/components/config/ConfigTypeScript.tsx +++ b/packages/website/src/components/config/ConfigTypeScript.tsx @@ -1,13 +1,14 @@ import React, { useCallback } from 'react'; import tsConfigOptions from '../tsConfigOptions.json'; -import type { CompilerFlags } from '../types'; import ConfigEditor from './ConfigEditor'; +import type { CompilerFlags } from '../types'; +import { shallowEqual } from '../lib/shallowEqual'; interface ModalTypeScriptProps { - isOpen: boolean; - onClose: (config: CompilerFlags) => void; - config?: CompilerFlags; + readonly isOpen: boolean; + readonly onClose: (config?: CompilerFlags) => void; + readonly config?: CompilerFlags; } function checkOptions(item: [string, unknown]): item is [string, boolean] { @@ -17,11 +18,16 @@ function checkOptions(item: [string, unknown]): item is [string, boolean] { function ConfigTypeScript(props: ModalTypeScriptProps): JSX.Element { const onClose = useCallback( (newConfig: Record) => { - props.onClose( - Object.fromEntries(Object.entries(newConfig).filter(checkOptions)), + const cfg = Object.fromEntries( + Object.entries(newConfig).filter(checkOptions), ); + if (!shallowEqual(cfg, props.config)) { + props.onClose(cfg); + } else { + props.onClose(); + } }, - [props.onClose], + [props.onClose, props.config], ); return ( diff --git a/packages/website/src/components/hooks/useHashState.ts b/packages/website/src/components/hooks/useHashState.ts index d6a8e8cc8e91..b1263ce04ccb 100644 --- a/packages/website/src/components/hooks/useHashState.ts +++ b/packages/website/src/components/hooks/useHashState.ts @@ -3,6 +3,7 @@ import { useCallback, useEffect, useState } from 'react'; import type { CompilerFlags, ConfigModel, RulesRecord } from '../types'; import * as lz from 'lzstring.ts'; +import { shallowEqual } from '../lib/shallowEqual'; function writeQueryParam(value: string): string { return lz.LZString.compressToEncodedURIComponent(value); @@ -76,26 +77,6 @@ const writeStateToUrl = (newState: ConfigModel): string => { return ''; }; -function shallowEqual( - object1: Record | ConfigModel | undefined, - object2: Record | ConfigModel | undefined, -): boolean { - if (object1 === object2) { - return true; - } - const keys1 = Object.keys(object1 ?? {}); - const keys2 = Object.keys(object2 ?? {}); - if (keys1.length !== keys2.length) { - return false; - } - for (const key of keys1) { - if (object1![key] !== object2![key]) { - return false; - } - } - return true; -} - function useHashState( initialState: ConfigModel, ): [ConfigModel, (cfg: Partial) => void] { diff --git a/packages/website/src/components/lib/shallowEqual.ts b/packages/website/src/components/lib/shallowEqual.ts new file mode 100644 index 000000000000..2f34444c5874 --- /dev/null +++ b/packages/website/src/components/lib/shallowEqual.ts @@ -0,0 +1,21 @@ +import type { ConfigModel } from '@site/src/components/types'; + +export function shallowEqual( + object1: Record | ConfigModel | undefined, + object2: Record | ConfigModel | undefined, +): boolean { + if (object1 === object2) { + return true; + } + const keys1 = Object.keys(object1 ?? {}); + const keys2 = Object.keys(object2 ?? {}); + if (keys1.length !== keys2.length) { + return false; + } + for (const key of keys1) { + if (object1![key] !== object2![key]) { + return false; + } + } + return true; +} diff --git a/packages/website/src/components/modals/Modal.module.css b/packages/website/src/components/modals/Modal.module.css index 45c0099482d2..694b1b113fc5 100644 --- a/packages/website/src/components/modals/Modal.module.css +++ b/packages/website/src/components/modals/Modal.module.css @@ -38,7 +38,8 @@ } .modalClose { - cursor: pointer; + transition: color var(--ifm-transition-fast) + var(--ifm-transition-timing-default); } .modalClose:hover, diff --git a/packages/website/src/components/modals/Modal.tsx b/packages/website/src/components/modals/Modal.tsx index ff17a0d89f6b..fe380b1ccb6d 100644 --- a/packages/website/src/components/modals/Modal.tsx +++ b/packages/website/src/components/modals/Modal.tsx @@ -1,5 +1,5 @@ /* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */ -import React from 'react'; +import React, { MouseEvent, useCallback, useEffect } from 'react'; import clsx from 'clsx'; import styles from './Modal.module.css'; import CloseIcon from '../icons/CloseIcon'; @@ -12,24 +12,48 @@ interface ModalProps { } function Modal(props: ModalProps): JSX.Element { + useEffect(() => { + const closeOnEscapeKeyDown = (e: KeyboardEvent): void => { + if (e.key === 'Escape' || e.keyCode === 27) { + props.onClose(); + } + }; + + document.body.addEventListener('keydown', closeOnEscapeKeyDown); + return (): void => { + document.body.removeEventListener('keydown', closeOnEscapeKeyDown); + }; + }, []); + + const onClick = useCallback( + (e: MouseEvent) => { + if (e.currentTarget === e.target) { + props.onClose(); + } + }, + [props.onClose], + ); + return (
{ - e.stopPropagation(); - }} >

{props.header}

- + className={clsx(styles.modalClose, 'clean-btn')} + type="button" + > + +
{React.Children.map(props.children, child => child)} From 114c2dcd3bed23bd0f7c07c99659bb99b94dfebf Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 9 Dec 2021 05:24:20 +0100 Subject: [PATCH 17/19] docs(eslint-plugin): update readme and roadmap links to point to website (#4277) --- packages/eslint-plugin/README.md | 6 +- packages/eslint-plugin/ROADMAP.md | 116 +++++++++++++++--------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 1b71e9158a21..d13577d9258d 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -10,8 +10,8 @@ ## Getting Started -- **[You can find our Getting Started docs here](../../docs/linting/README.md)** -- **[You can find our FAQ / Troubleshooting docs here](../../docs/linting/TROUBLESHOOTING.md)** +- **[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting/linting)** +- **[You can find our FAQ / Troubleshooting docs here](https://typescript-eslint.io/docs/linting/troubleshooting)** These docs walk you through setting up ESLint, this plugin, and our parser. If you know what you're doing and just want to quick start, read on... @@ -87,7 +87,7 @@ Some highly valuable rules require type-checking in order to be implemented corr Pro Tip: For larger codebases you may want to consider splitting our linting into two separate stages: 1. fast feedback rules which operate purely based on syntax (no type-checking), 2. rules which are based on semantics (type-checking). -**[You can read more about linting with type information here](../../docs/linting/TYPED_LINTING.md)** +**[You can read more about linting with type information here](https://typescript-eslint.io/docs/linting/type-linting)** ## Supported Rules diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 7dc6efe1c095..d6f0cf393db0 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -592,64 +592,64 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- -[`@typescript-eslint/adjacent-overload-signatures`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md -[`@typescript-eslint/await-thenable`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/await-thenable.md -[`@typescript-eslint/ban-types`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/ban-types.md -[`@typescript-eslint/ban-ts-comment`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/ban-ts-comment.md -[`@typescript-eslint/consistent-type-assertions`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-assertions.md -[`@typescript-eslint/consistent-type-definitions`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-definitions.md -[`@typescript-eslint/explicit-member-accessibility`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md -[`@typescript-eslint/member-ordering`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/member-ordering.md -[`@typescript-eslint/method-signature-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/method-signature-style.md -[`@typescript-eslint/no-explicit-any`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-explicit-any.md -[`@typescript-eslint/no-empty-interface`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-empty-interface.md -[`@typescript-eslint/no-implied-eval`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-implied-eval.md -[`@typescript-eslint/no-inferrable-types`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-inferrable-types.md -[`@typescript-eslint/prefer-namespace-keyword`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md -[`@typescript-eslint/promise-function-async`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/promise-function-async.md -[`@typescript-eslint/no-misused-promises`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md -[`@typescript-eslint/no-namespace`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-namespace.md -[`@typescript-eslint/no-non-null-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-non-null-assertion.md -[`@typescript-eslint/triple-slash-reference`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/triple-slash-reference.md -[`@typescript-eslint/unbound-method`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unbound-method.md -[`@typescript-eslint/no-unnecessary-type-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md -[`@typescript-eslint/no-var-requires`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-var-requires.md -[`@typescript-eslint/type-annotation-spacing`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/type-annotation-spacing.md -[`@typescript-eslint/typedef`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/typedef.md -[`@typescript-eslint/unified-signatures`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unified-signatures.md -[`@typescript-eslint/no-unnecessary-boolean-literal-compare`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md -[`@typescript-eslint/no-misused-new`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-new.md -[`@typescript-eslint/no-this-alias`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-this-alias.md -[`@typescript-eslint/no-throw-literal`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-throw-literal.md -[`@typescript-eslint/no-extraneous-class`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-extraneous-class.md -[`@typescript-eslint/no-unused-vars`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unused-vars.md -[`@typescript-eslint/no-use-before-define`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-use-before-define.md -[`@typescript-eslint/restrict-plus-operands`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/restrict-plus-operands.md -[`@typescript-eslint/strict-boolean-expressions`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md -[`@typescript-eslint/indent`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/indent.md -[`@typescript-eslint/no-invalid-void-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-invalid-void-type.md -[`@typescript-eslint/no-require-imports`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-require-imports.md -[`@typescript-eslint/array-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/array-type.md -[`@typescript-eslint/naming-convention`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md -[`@typescript-eslint/interface-name-prefix`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/interface-name-prefix.md -[`@typescript-eslint/naming-convention`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md -[`@typescript-eslint/no-parameter-properties`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-parameter-properties.md -[`@typescript-eslint/member-delimiter-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/member-delimiter-style.md -[`@typescript-eslint/prefer-for-of`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-for-of.md -[`@typescript-eslint/no-array-constructor`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-array-constructor.md -[`@typescript-eslint/no-dynamic-delete`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-dynamic-delete.md -[`@typescript-eslint/prefer-function-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-function-type.md -[`@typescript-eslint/prefer-readonly`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-readonly.md -[`@typescript-eslint/require-await`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/require-await.md -[`@typescript-eslint/no-for-in-array`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-for-in-array.md -[`@typescript-eslint/no-unnecessary-qualifier`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md -[`@typescript-eslint/no-unnecessary-type-arguments`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md -[`@typescript-eslint/semi`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/semi.md -[`@typescript-eslint/no-floating-promises`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-floating-promises.md -[`@typescript-eslint/no-magic-numbers`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-magic-numbers.md -[`@typescript-eslint/no-unsafe-member-access`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md -[`@typescript-eslint/restrict-template-expressions`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/restrict-template-expressions.md -[`@typescript-eslint/no-confusing-void-expression`]: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md +[`@typescript-eslint/adjacent-overload-signatures`]: https://typescript-eslint.io/rules/adjacent-overload-signatures +[`@typescript-eslint/await-thenable`]: https://typescript-eslint.io/rules/await-thenable +[`@typescript-eslint/ban-types`]: https://typescript-eslint.io/rules/ban-types +[`@typescript-eslint/ban-ts-comment`]: https://typescript-eslint.io/rules/ban-ts-comment +[`@typescript-eslint/consistent-type-assertions`]: https://typescript-eslint.io/rules/consistent-type-assertions +[`@typescript-eslint/consistent-type-definitions`]: https://typescript-eslint.io/rules/consistent-type-definitions +[`@typescript-eslint/explicit-member-accessibility`]: https://typescript-eslint.io/rules/explicit-member-accessibility +[`@typescript-eslint/member-ordering`]: https://typescript-eslint.io/rules/member-ordering +[`@typescript-eslint/method-signature-style`]: https://typescript-eslint.io/rules/method-signature-style +[`@typescript-eslint/no-explicit-any`]: https://typescript-eslint.io/rules/no-explicit-any +[`@typescript-eslint/no-empty-interface`]: https://typescript-eslint.io/rules/no-empty-interface +[`@typescript-eslint/no-implied-eval`]: https://typescript-eslint.io/rules/no-implied-eval +[`@typescript-eslint/no-inferrable-types`]: https://typescript-eslint.io/rules/no-inferrable-types +[`@typescript-eslint/prefer-namespace-keyword`]: https://typescript-eslint.io/rules/prefer-namespace-keyword +[`@typescript-eslint/promise-function-async`]: https://typescript-eslint.io/rules/promise-function-async +[`@typescript-eslint/no-misused-promises`]: https://typescript-eslint.io/rules/no-misused-promises +[`@typescript-eslint/no-namespace`]: https://typescript-eslint.io/rules/no-namespace +[`@typescript-eslint/no-non-null-assertion`]: https://typescript-eslint.io/rules/no-non-null-assertion +[`@typescript-eslint/triple-slash-reference`]: https://typescript-eslint.io/rules/triple-slash-reference +[`@typescript-eslint/unbound-method`]: https://typescript-eslint.io/rules/unbound-method +[`@typescript-eslint/no-unnecessary-type-assertion`]: https://typescript-eslint.io/rules/no-unnecessary-type-assertion +[`@typescript-eslint/no-var-requires`]: https://typescript-eslint.io/rules/no-var-requires +[`@typescript-eslint/type-annotation-spacing`]: https://typescript-eslint.io/rules/type-annotation-spacing +[`@typescript-eslint/typedef`]: https://typescript-eslint.io/rules/typedef +[`@typescript-eslint/unified-signatures`]: https://typescript-eslint.io/rules/unified-signatures +[`@typescript-eslint/no-unnecessary-boolean-literal-compare`]: https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare +[`@typescript-eslint/no-misused-new`]: https://typescript-eslint.io/rules/no-misused-new +[`@typescript-eslint/no-this-alias`]: https://typescript-eslint.io/rules/no-this-alias +[`@typescript-eslint/no-throw-literal`]: https://typescript-eslint.io/rules/no-throw-literal +[`@typescript-eslint/no-extraneous-class`]: https://typescript-eslint.io/rules/no-extraneous-class +[`@typescript-eslint/no-unused-vars`]: https://typescript-eslint.io/rules/no-unused-vars +[`@typescript-eslint/no-use-before-define`]: https://typescript-eslint.io/rules/no-use-before-define +[`@typescript-eslint/restrict-plus-operands`]: https://typescript-eslint.io/rules/restrict-plus-operands +[`@typescript-eslint/strict-boolean-expressions`]: https://typescript-eslint.io/rules/strict-boolean-expressions +[`@typescript-eslint/indent`]: https://typescript-eslint.io/rules/indent +[`@typescript-eslint/no-invalid-void-type`]: https://typescript-eslint.io/rules/no-invalid-void-type +[`@typescript-eslint/no-require-imports`]: https://typescript-eslint.io/rules/no-require-imports +[`@typescript-eslint/array-type`]: https://typescript-eslint.io/rules/array-type +[`@typescript-eslint/naming-convention`]: https://typescript-eslint.io/rules/naming-convention +[`@typescript-eslint/interface-name-prefix`]: https://typescript-eslint.io/rules/interface-name-prefix +[`@typescript-eslint/naming-convention`]: https://typescript-eslint.io/rules/naming-convention +[`@typescript-eslint/no-parameter-properties`]: https://typescript-eslint.io/rules/no-parameter-properties +[`@typescript-eslint/member-delimiter-style`]: https://typescript-eslint.io/rules/member-delimiter-style +[`@typescript-eslint/prefer-for-of`]: https://typescript-eslint.io/rules/prefer-for-of +[`@typescript-eslint/no-array-constructor`]: https://typescript-eslint.io/rules/no-array-constructor +[`@typescript-eslint/no-dynamic-delete`]: https://typescript-eslint.io/rules/no-dynamic-delete +[`@typescript-eslint/prefer-function-type`]: https://typescript-eslint.io/rules/prefer-function-type +[`@typescript-eslint/prefer-readonly`]: https://typescript-eslint.io/rules/prefer-readonly +[`@typescript-eslint/require-await`]: https://typescript-eslint.io/rules/require-await +[`@typescript-eslint/no-for-in-array`]: https://typescript-eslint.io/rules/no-for-in-array +[`@typescript-eslint/no-unnecessary-qualifier`]: https://typescript-eslint.io/rules/no-unnecessary-qualifier +[`@typescript-eslint/no-unnecessary-type-arguments`]: https://typescript-eslint.io/rules/no-unnecessary-type-arguments +[`@typescript-eslint/semi`]: https://typescript-eslint.io/rules/semi +[`@typescript-eslint/no-floating-promises`]: https://typescript-eslint.io/rules/no-floating-promises +[`@typescript-eslint/no-magic-numbers`]: https://typescript-eslint.io/rules/no-magic-numbers +[`@typescript-eslint/no-unsafe-member-access`]: https://typescript-eslint.io/rules/no-unsafe-member-access +[`@typescript-eslint/restrict-template-expressions`]: https://typescript-eslint.io/rules/restrict-template-expressions +[`@typescript-eslint/no-confusing-void-expression`]: https://typescript-eslint.io/rules/no-confusing-void-expression From b9407c560c8ab625fd546af73f71cce8178b9e05 Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 10 Dec 2021 06:59:00 +0100 Subject: [PATCH 18/19] docs(website): add simple ts ast viewer (#4243) * docs(website): initial refactor of AstViewer * docs(website): add simple ts ast viewer * docs(website): correct issues with rendering ast * docs(website): filter out SyntaxKind * docs(website): expand flags in tooltips * docs(website): change checkboxes to dropdown in AST Viewer * docs(website): correct length value for custom arrays * docs(website): cleanup code * docs(website): rename getTypeName to getNodeName and formatValue to getTooltip * docs(website): add support for selection in ts ast viewer * docs(website): allow configuration of filterProps * docs(website): do not include last column in range * docs(website): remove redundant styles * docs: apply changes from code review --- packages/website-eslint/src/linter/linter.js | 6 + packages/website-eslint/src/linter/parser.js | 4 +- packages/website-eslint/types/index.d.ts | 1 + .../src/components/ASTViewerESTree.tsx | 52 ++++ .../website/src/components/ASTViewerTS.tsx | 149 ++++++++++ .../src/components/OptionsSelector.tsx | 35 +-- .../src/components/Playground.module.css | 2 +- .../website/src/components/Playground.tsx | 50 ++-- .../src/components/ast/ASTViewer.module.css | 45 ++-- .../website/src/components/ast/ASTViewer.tsx | 36 +-- .../website/src/components/ast/Elements.tsx | 254 ++++++------------ .../website/src/components/ast/HiddenItem.tsx | 48 ++++ .../website/src/components/ast/ItemGroup.tsx | 52 ++++ .../src/components/ast/PropertyName.tsx | 63 +++-- .../src/components/ast/PropertyValue.tsx | 11 +- .../website/src/components/ast/selection.ts | 79 ------ packages/website/src/components/ast/types.ts | 38 ++- packages/website/src/components/ast/utils.ts | 71 +++++ .../src/components/editor/LoadedEditor.tsx | 15 +- .../website/src/components/editor/types.ts | 7 +- .../components/hooks/useDebouncedToggle.ts | 26 ++ .../src/components/hooks/useHashState.ts | 21 +- .../src/components/inputs/Dropdown.tsx | 38 ++- .../src/components/inputs/Tooltip.module.css | 93 +++++-- .../website/src/components/inputs/Tooltip.tsx | 26 +- .../src/components/lib/shallowEqual.ts | 6 +- packages/website/src/components/types.ts | 12 +- 27 files changed, 829 insertions(+), 411 deletions(-) create mode 100644 packages/website/src/components/ASTViewerESTree.tsx create mode 100644 packages/website/src/components/ASTViewerTS.tsx create mode 100644 packages/website/src/components/ast/HiddenItem.tsx create mode 100644 packages/website/src/components/ast/ItemGroup.tsx delete mode 100644 packages/website/src/components/ast/selection.ts create mode 100644 packages/website/src/components/ast/utils.ts create mode 100644 packages/website/src/components/hooks/useDebouncedToggle.ts diff --git a/packages/website-eslint/src/linter/linter.js b/packages/website-eslint/src/linter/linter.js index 4b798674eeb6..1643dcf2562f 100644 --- a/packages/website-eslint/src/linter/linter.js +++ b/packages/website-eslint/src/linter/linter.js @@ -8,11 +8,13 @@ const PARSER_NAME = '@typescript-eslint/parser'; export function loadLinter() { const linter = new Linter(); let storedAST; + let storedTsAST; linter.defineParser(PARSER_NAME, { parseForESLint(code, options) { const toParse = parseForESLint(code, options); storedAST = toParse.ast; + storedTsAST = toParse.tsAst; return toParse; }, // parse(code: string, options: ParserOptions): ParseForESLintResult['ast'] { // const toParse = parseForESLint(code, options); @@ -39,6 +41,10 @@ export function loadLinter() { return storedAST; }, + getTsAst() { + return storedTsAST; + }, + lint(code, parserOptions, rules) { return linter.verify(code, { parser: PARSER_NAME, diff --git a/packages/website-eslint/src/linter/parser.js b/packages/website-eslint/src/linter/parser.js index 282f67c0da7a..41c0b24baf10 100644 --- a/packages/website-eslint/src/linter/parser.js +++ b/packages/website-eslint/src/linter/parser.js @@ -14,6 +14,7 @@ function parseAndGenerateServices(code, options) { return { ast: estree, + tsAst: ast, services: { hasFullTypeInformation: true, program, @@ -24,7 +25,7 @@ function parseAndGenerateServices(code, options) { } export function parseForESLint(code, parserOptions) { - const { ast, services } = parseAndGenerateServices(code, { + const { ast, tsAst, services } = parseAndGenerateServices(code, { ...parserOptions, jsx: parserOptions.ecmaFeatures?.jsx ?? false, useJSXTextNode: true, @@ -40,6 +41,7 @@ export function parseForESLint(code, parserOptions) { return { ast, + tsAst, services, scopeManager, visitorKeys, diff --git a/packages/website-eslint/types/index.d.ts b/packages/website-eslint/types/index.d.ts index eaa86160cba7..86e0c02eed6c 100644 --- a/packages/website-eslint/types/index.d.ts +++ b/packages/website-eslint/types/index.d.ts @@ -12,6 +12,7 @@ export interface WebLinter { ruleNames: { name: string; description?: string }[]; getAst(): ESLintAST; + getTsAst(): Record; lint( code: string, diff --git a/packages/website/src/components/ASTViewerESTree.tsx b/packages/website/src/components/ASTViewerESTree.tsx new file mode 100644 index 000000000000..899daeedba9a --- /dev/null +++ b/packages/website/src/components/ASTViewerESTree.tsx @@ -0,0 +1,52 @@ +import React, { useCallback } from 'react'; + +import ASTViewer from './ast/ASTViewer'; +import { isRecord } from './ast/utils'; +import type { ASTViewerBaseProps, SelectedRange } from './ast/types'; +import { TSESTree } from '@typescript-eslint/website-eslint'; + +function isESTreeNode( + value: unknown, +): value is Record & TSESTree.BaseNode { + return isRecord(value) && 'type' in value && 'loc' in value; +} + +export const propsToFilter = ['parent', 'comments', 'tokens']; + +export default function ASTViewerESTree( + props: ASTViewerBaseProps, +): JSX.Element { + const filterProps = useCallback( + (item: [string, unknown]): boolean => + !propsToFilter.includes(item[0]) && + !item[0].startsWith('_') && + item[1] !== undefined, + [], + ); + + const getRange = useCallback( + (value: unknown): SelectedRange | undefined => + isESTreeNode(value) + ? { + start: value.loc.start, + end: value.loc.end, + } + : undefined, + [], + ); + + const getNodeName = useCallback( + (value: unknown): string | undefined => + isESTreeNode(value) ? String(value.type) : undefined, + [], + ); + + return ( + + ); +} diff --git a/packages/website/src/components/ASTViewerTS.tsx b/packages/website/src/components/ASTViewerTS.tsx new file mode 100644 index 000000000000..f30265ba574e --- /dev/null +++ b/packages/website/src/components/ASTViewerTS.tsx @@ -0,0 +1,149 @@ +import React, { useCallback, useEffect, useState } from 'react'; + +import ASTViewer from './ast/ASTViewer'; +import { isRecord } from './ast/utils'; +import type { + ASTViewerBaseProps, + SelectedRange, + SelectedPosition, +} from './ast/types'; +import type { Node, SourceFile } from 'typescript'; + +export interface ASTTsViewerProps extends ASTViewerBaseProps { + readonly version: string; +} + +function extractEnum( + obj: Record, +): Record { + const result: Record = {}; + const keys = Object.entries(obj); + for (const [name, value] of keys) { + if (typeof value === 'number') { + if (!(value in result)) { + result[value] = name; + } + } + } + return result; +} + +function isTsNode(value: unknown): value is Node { + return isRecord(value) && typeof value.kind === 'number'; +} + +function getFlagNamesFromEnum( + allFlags: Record, + flags: number, + prefix: string, +): string[] { + return Object.entries(allFlags) + .filter(([f, _]) => (Number(f) & flags) !== 0) + .map(([_, name]) => `${prefix}.${name}`); +} + +export function getLineAndCharacterFor( + pos: number, + ast: SourceFile, +): SelectedPosition { + const loc = ast.getLineAndCharacterOfPosition(pos); + return { + line: loc.line + 1, + column: loc.character, + }; +} + +export function getLocFor( + start: number, + end: number, + ast: SourceFile, +): SelectedRange { + return { + start: getLineAndCharacterFor(start, ast), + end: getLineAndCharacterFor(end, ast), + }; +} + +export const propsToFilter = [ + 'parent', + 'jsDoc', + 'lineMap', + 'externalModuleIndicator', + 'bindDiagnostics', + 'transformFlags', + 'resolvedModules', + 'imports', +]; + +export default function ASTViewerTS(props: ASTTsViewerProps): JSX.Element { + const [syntaxKind, setSyntaxKind] = useState>({}); + const [nodeFlags, setNodeFlags] = useState>({}); + const [tokenFlags, setTokenFlags] = useState>({}); + const [modifierFlags, setModifierFlags] = useState>( + {}, + ); + + useEffect(() => { + setSyntaxKind(extractEnum(window.ts.SyntaxKind)); + setNodeFlags(extractEnum(window.ts.NodeFlags)); + setTokenFlags(extractEnum(window.ts.TokenFlags)); + setModifierFlags(extractEnum(window.ts.ModifierFlags)); + }, [props.version]); + + const getTooltip = useCallback( + (key: string, value: unknown): string | undefined => { + if (key === 'flags' && typeof value === 'number') { + return getFlagNamesFromEnum(nodeFlags, value, 'NodeFlags').join('\n'); + } else if (key === 'numericLiteralFlags' && typeof value === 'number') { + return getFlagNamesFromEnum(tokenFlags, value, 'TokenFlags').join('\n'); + } else if (key === 'modifierFlagsCache' && typeof value === 'number') { + return getFlagNamesFromEnum(modifierFlags, value, 'ModifierFlags').join( + '\n', + ); + } else if (key === 'kind' && typeof value === 'number') { + return `SyntaxKind.${syntaxKind[value]}`; + } + return undefined; + }, + [nodeFlags, tokenFlags, syntaxKind], + ); + + const getNodeName = useCallback( + (value: unknown): string | undefined => + isTsNode(value) ? syntaxKind[value.kind] : undefined, + [syntaxKind], + ); + + const filterProps = useCallback( + (item: [string, unknown]): boolean => + !propsToFilter.includes(item[0]) && + !item[0].startsWith('_') && + item[1] !== undefined, + [], + ); + + const getRange = useCallback( + (value: unknown): SelectedRange | undefined => { + if (props.value && isTsNode(value)) { + return getLocFor( + value.pos, + value.end, + // @ts-expect-error: unsafe cast + props.value as SourceFile, + ); + } + return undefined; + }, + [props.value], + ); + + return ( + + ); +} diff --git a/packages/website/src/components/OptionsSelector.tsx b/packages/website/src/components/OptionsSelector.tsx index 023efce6315d..ee1f14648d9d 100644 --- a/packages/website/src/components/OptionsSelector.tsx +++ b/packages/website/src/components/OptionsSelector.tsx @@ -10,18 +10,15 @@ import Tooltip from './inputs/Tooltip'; import EditIcon from './icons/EditIcon'; import CopyIcon from './icons/CopyIcon'; +import useDebouncedToggle from './hooks/useDebouncedToggle'; + import { createMarkdown } from './lib/markdown'; import type { RuleDetails } from './types'; import styles from './OptionsSelector.module.css'; -import type { - CompilerFlags, - ConfigModel, - SourceType, - RulesRecord, -} from './types'; +import type { CompilerFlags, ConfigModel, RulesRecord } from './types'; export interface OptionsSelectorParams { readonly ruleOptions: RuleDetails[]; @@ -31,6 +28,12 @@ export interface OptionsSelectorParams { readonly isLoading: boolean; } +const ASTOptions = [ + { value: false, label: 'Disabled' }, + { value: 'es', label: 'ESTree' }, + { value: 'ts', label: 'TypeScript' }, +] as const; + function OptionsSelector({ ruleOptions, state, @@ -40,8 +43,8 @@ function OptionsSelector({ }: OptionsSelectorParams): JSX.Element { const [eslintModal, setEslintModal] = useState(false); const [typeScriptModal, setTypeScriptModal] = useState(false); - const [copyLink, setCopyLink] = useState(false); - const [copyMarkdown, setCopyMarkdown] = useState(false); + const [copyLink, setCopyLink] = useDebouncedToggle(false); + const [copyMarkdown, setCopyMarkdown] = useDebouncedToggle(false); const updateTS = useCallback( (version: string) => { @@ -145,12 +148,12 @@ function OptionsSelector({ /> @@ -180,7 +183,7 @@ function OptionsSelector({ @@ -189,7 +192,7 @@ function OptionsSelector({ onClick={copyMarkdownToClipboard} > Copy Markdown - + diff --git a/packages/website/src/components/Playground.module.css b/packages/website/src/components/Playground.module.css index 6c5a9fdad71e..f1d78f13c6c4 100644 --- a/packages/website/src/components/Playground.module.css +++ b/packages/website/src/components/Playground.module.css @@ -25,8 +25,8 @@ height: 100%; width: 50%; border: 1px solid var(--ifm-color-emphasis-100); + padding: 0; overflow: auto; - background: var(--ifm-background-surface-color); word-wrap: initial; white-space: nowrap; background: var(--code-editor-bg); diff --git a/packages/website/src/components/Playground.tsx b/packages/website/src/components/Playground.tsx index f0c7903e5f27..844b955dd8b8 100644 --- a/packages/website/src/components/Playground.tsx +++ b/packages/website/src/components/Playground.tsx @@ -8,10 +8,14 @@ import Loader from './layout/Loader'; import useHashState from './hooks/useHashState'; import OptionsSelector from './OptionsSelector'; -import ASTViewer from './ast/ASTViewer'; import { LoadingEditor } from './editor/LoadingEditor'; import { EditorEmbed } from './editor/EditorEmbed'; -import type { RuleDetails } from './types'; +import { shallowEqual } from './lib/shallowEqual'; + +import ASTViewerESTree from './ASTViewerESTree'; +import ASTViewerTS from './ASTViewerTS'; + +import type { RuleDetails, SelectedRange } from './types'; import type { TSESTree } from '@typescript-eslint/website-eslint'; @@ -26,25 +30,28 @@ function Playground(): JSX.Element { tsConfig: {}, }); const { isDarkTheme } = useThemeContext(); - const [ast, setAST] = useState(); + const [esAst, setEsAst] = useState(); + const [tsAst, setTsAST] = useState | string | null>(); const [ruleNames, setRuleNames] = useState([]); const [isLoading, setIsLoading] = useState(true); const [tsVersions, setTSVersion] = useState([]); - const [selectedNode, setSelectedNode] = useState(null); + const [selectedRange, setSelectedRange] = useState( + null, + ); const [position, setPosition] = useState(null); const updateSelectedNode = useCallback( - (node: TSESTree.Node | null) => { + (value: SelectedRange | null) => { if ( - !node || - !selectedNode || - selectedNode.range[0] !== node.range[0] || - selectedNode.range[1] !== node.range[1] + !value || + !selectedRange || + !shallowEqual(selectedRange.start, value.start) || + !shallowEqual(selectedRange.end, value.end) ) { - setSelectedNode(node); + setSelectedRange(value); } }, - [selectedNode], + [selectedRange], ); return ( @@ -76,8 +83,9 @@ function Playground(): JSX.Element { sourceType={state.sourceType} rules={state.rules} showAST={state.showAST} - onASTChange={setAST} - decoration={selectedNode} + onEsASTChange={setEsAst} + onTsASTChange={setTsAST} + decoration={selectedRange} onChange={(code): void => setState({ code: code })} onLoaded={(ruleNames, tsVersions): void => { setRuleNames(ruleNames); @@ -89,13 +97,21 @@ function Playground(): JSX.Element {
{state.showAST && (
- {ast && ( - - )} + )) || + (esAst && ( + + ))}
)}
diff --git a/packages/website/src/components/ast/ASTViewer.module.css b/packages/website/src/components/ast/ASTViewer.module.css index 1739f872ecb6..84a40b866c26 100644 --- a/packages/website/src/components/ast/ASTViewer.module.css +++ b/packages/website/src/components/ast/ASTViewer.module.css @@ -1,16 +1,24 @@ +.list { + font-family: var(--ifm-font-family-monospace); + background: transparent; + border: none; + padding: 0; + font-size: 13px; + line-height: 18px; + letter-spacing: 0; + font-feature-settings: 'liga' 0, 'calt' 0; +} + .list, .subList { - cursor: default; box-sizing: border-box; + white-space: break-spaces; margin: 0; - list-style: none; padding-left: 1.5rem; - font-family: Consolas, 'Courier New', monospace; - font-weight: normal; - font-size: 13px; - font-feature-settings: 'liga' 0, 'calt' 0; - line-height: 18px; - letter-spacing: 0px; +} + +.selected { + background: var(--code-line-decoration); } .nonExpand, @@ -22,10 +30,6 @@ content: '+'; } -.selected { - background: var(--code-line-decoration); -} - .expand::before { content: '-'; margin-left: -1rem; @@ -58,6 +62,10 @@ color: #b58900; } +.propClass { + color: #b58900; +} + .propBoolean { color: #b58900; } @@ -68,11 +76,10 @@ .hidden { color: var(--ifm-color-emphasis-400); -} - -.clickable { - cursor: pointer; -} -.clickable:hover { - text-decoration: underline; + max-width: 40%; + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: bottom; } diff --git a/packages/website/src/components/ast/ASTViewer.tsx b/packages/website/src/components/ast/ASTViewer.tsx index 7c234f91a238..aa1e35687ec0 100644 --- a/packages/website/src/components/ast/ASTViewer.tsx +++ b/packages/website/src/components/ast/ASTViewer.tsx @@ -1,25 +1,13 @@ import React, { useEffect, useState } from 'react'; import styles from './ASTViewer.module.css'; -import type { TSESTree } from '@typescript-eslint/website-eslint'; -import type { Position } from './types'; +import type { SelectedPosition, ASTViewerProps } from './types'; -import { ElementObject } from './Elements'; -import type Monaco from 'monaco-editor'; +import { ComplexItem } from './Elements'; +import { isRecord } from './utils'; -function ASTViewer(props: { - ast: TSESTree.Node | string; - position?: Monaco.Position | null; - onSelectNode: (node: TSESTree.Node | null) => void; -}): JSX.Element { - const [selection, setSelection] = useState(() => - props.position - ? { - line: props.position.lineNumber, - column: props.position.column - 1, - } - : null, - ); +function ASTViewer(props: ASTViewerProps): JSX.Element { + const [selection, setSelection] = useState(null); useEffect(() => { setSelection( @@ -32,17 +20,21 @@ function ASTViewer(props: { ); }, [props.position]); - return typeof props.ast === 'string' ? ( -
{props.ast}
- ) : ( + return isRecord(props.value) ? (
-
+ ) : ( +
{props.value}
); } diff --git a/packages/website/src/components/ast/Elements.tsx b/packages/website/src/components/ast/Elements.tsx index 9dba9eff491a..be573770d94d 100644 --- a/packages/website/src/components/ast/Elements.tsx +++ b/packages/website/src/components/ast/Elements.tsx @@ -1,218 +1,140 @@ -import React, { - SyntheticEvent, - useCallback, - useEffect, - useRef, - useState, -} from 'react'; -import clsx from 'clsx'; +import React, { useCallback, useEffect, useState } from 'react'; -import type { TSESTree } from '@typescript-eslint/website-eslint'; import type { GenericParams } from './types'; -import { scrollIntoViewIfNeeded } from '@site/src/components/lib/scroll-into'; -import { - filterRecord, - hasChildInRange, - isArrayInRange, - isEsNode, - isInRange, - isRecord, -} from './selection'; +import { hasChildInRange, isArrayInRange, isInRange, isRecord } from './utils'; -import PropertyNameComp from '@site/src/components/ast/PropertyName'; -import PropertyValueComp from '@site/src/components/ast/PropertyValue'; import styles from '@site/src/components/ast/ASTViewer.module.css'; -export const PropertyName = React.memo(PropertyNameComp); -export const PropertyValue = React.memo(PropertyValueComp); +import PropertyValue from '@site/src/components/ast/PropertyValue'; +import ItemGroup from '@site/src/components/ast/ItemGroup'; +import HiddenItem from '@site/src/components/ast/HiddenItem'; +import Tooltip from '@site/src/components/inputs/Tooltip'; -export function ElementArray(props: GenericParams): JSX.Element { - const [isComplex, setIsComplex] = useState(() => - isRecord(props.value), - ); +export function ComplexItem( + props: GenericParams | unknown[]>, +): JSX.Element { const [isExpanded, setIsExpanded] = useState( - () => - isComplex || props.value.some(item => isInRange(props.selection, item)), + () => props.level === 'ast', ); + const [isSelected, setIsSelected] = useState(false); + const [model, setModel] = useState<[string, unknown][]>([]); useEffect(() => { - setIsComplex( - props.value.some(item => typeof item === 'object' && item !== null), + setModel( + Object.entries(props.value).filter(item => props.filterProps(item)), ); - }, [props.value]); - - useEffect(() => { - if (isComplex && !isExpanded) { - setIsExpanded(isArrayInRange(props.selection, props.value)); - } - }, [props.value, props.selection]); - - return ( -
- setIsExpanded(!isExpanded)} - /> - [ - {isExpanded ? ( -
- {props.value.map((item, index) => { - return ( - - ); - })} -
- ) : !isComplex ? ( - - {props.value.map((item, index) => ( - - {index > 0 && ', '} - - - ))} - - ) : ( - - {props.value.length} {props.value.length > 1 ? 'elements' : 'element'} - - )} - ] -
- ); -} - -export function ElementObject( - props: GenericParams>, -): JSX.Element { - const [isExpanded, setIsExpanded] = useState(() => { - return isInRange(props.selection, props.value); - }); - const [isSelected, setIsSelected] = useState( - () => - isInRange(props.selection, props.value) && props.value.type !== 'Program', - ); - const listItem = useRef(null); - - const onMouseEnter = useCallback( - (e: SyntheticEvent) => { - if (isEsNode(props.value)) { - props.onSelectNode(props.value as TSESTree.Node); - e.stopPropagation(); - e.preventDefault(); - } - }, - [props.value], - ); - - const onMouseLeave = useCallback( - (_e: SyntheticEvent) => { - if (isEsNode(props.value)) { - props.onSelectNode(null); + }, [props.value, props.filterProps]); + + const onHover = useCallback( + (state: boolean) => { + if (props.onSelectNode) { + const range = props.getRange(props.value); + if (range) { + props.onSelectNode(state ? range : null); + } } }, [props.value], ); useEffect(() => { - const selected = isInRange(props.selection, props.value); + const selected = props.selection + ? props.isArray + ? isArrayInRange(props.selection, props.value, props.getRange) + : isInRange(props.selection, props.value, props.getRange) + : false; setIsSelected( - selected && - props.value.type !== 'Program' && - !hasChildInRange(props.selection, props.value), + props.level !== 'ast' && + selected && + !hasChildInRange(props.selection, model, props.getRange), ); if (selected && !isExpanded) { - setIsExpanded(isInRange(props.selection, props.value)); + setIsExpanded(selected); } - }, [props.selection, props.value]); - - useEffect(() => { - if (listItem.current && isSelected) { - scrollIntoViewIfNeeded(listItem.current); - } - }, [isSelected, listItem]); + }, [model, props.selection, props.value, props.isArray, props.getRange]); return ( -
setIsExpanded(!isExpanded)} > - setIsExpanded(!isExpanded)} - /> - {'{'} + {props.isArray ? '[' : '{'} {isExpanded ? (
- {filterRecord(props.value).map((item, index) => ( + {model.map((item, index) => ( ))}
) : ( - - {filterRecord(props.value) - .map(item => item[0]) - .join(', ')} - + + )} + {props.isArray ? ']' : '}'} + + ); +} + +export function SimpleItem(props: GenericParams): JSX.Element { + const [tooltip, setTooltip] = useState(); + + useEffect(() => { + setTooltip(props.getTooltip?.(props.propName ?? '', props.value)); + }, [props.getTooltip, props.propName, props.value]); + + return ( + + {tooltip ? ( + + + + ) : ( + )} - {'}'} -
+ ); } export function ElementItem(props: GenericParams): JSX.Element { - if (Array.isArray(props.value)) { + const isArray = Array.isArray(props.value); + if (isArray || isRecord(props.value)) { return ( - - ); - } else if ( - typeof props.value === 'object' && - props.value && - props.value.constructor === Object - ) { - return ( - } selection={props.selection} onSelectNode={props.onSelectNode} /> ); + } else { + return ; } - return ( -
- {props.name && {props.name}} - {props.name && : } - -
- ); } diff --git a/packages/website/src/components/ast/HiddenItem.tsx b/packages/website/src/components/ast/HiddenItem.tsx new file mode 100644 index 000000000000..26717b349567 --- /dev/null +++ b/packages/website/src/components/ast/HiddenItem.tsx @@ -0,0 +1,48 @@ +import React, { useEffect, useState } from 'react'; +import styles from './ASTViewer.module.css'; +import PropertyValue from './PropertyValue'; + +export interface HiddenItemProps { + readonly value: [string, unknown][]; + readonly level: string; + readonly isArray?: boolean; +} + +export default function HiddenItem(props: HiddenItemProps): JSX.Element { + const [isComplex, setIsComplex] = useState(true); + const [length, setLength] = useState(0); + + useEffect(() => { + if (props.isArray) { + const filtered = props.value.filter(item => !isNaN(Number(item[0]))); + setIsComplex( + !filtered.some(item => typeof item[1] !== 'object' || item[1] === null), + ); + setLength(filtered.length); + } + }, [props.value, props.isArray]); + + return ( + + {props.isArray && !isComplex ? ( + props.value.map((item, index) => ( + + {index > 0 && ', '} + + + )) + ) : props.isArray ? ( + <> + {length} {length === 1 ? 'element' : 'elements'} + + ) : ( + props.value.map((item, index) => ( + + {index > 0 && ', '} + {String(item[0])} + + )) + )} + + ); +} diff --git a/packages/website/src/components/ast/ItemGroup.tsx b/packages/website/src/components/ast/ItemGroup.tsx new file mode 100644 index 000000000000..a117c9c05f89 --- /dev/null +++ b/packages/website/src/components/ast/ItemGroup.tsx @@ -0,0 +1,52 @@ +import React, { MouseEvent, useEffect, useRef } from 'react'; +import { scrollIntoViewIfNeeded } from '@site/src/components/lib/scroll-into'; +import clsx from 'clsx'; + +import styles from './ASTViewer.module.css'; + +import PropertyNameComp from './PropertyName'; +import type { GetNodeNameFn } from './types'; + +const PropertyName = React.memo(PropertyNameComp); + +export interface ItemGroupProps { + readonly propName?: string; + readonly value: unknown; + readonly getNodeName: GetNodeNameFn; + readonly isSelected?: boolean; + readonly isExpanded?: boolean; + readonly canExpand?: boolean; + readonly onClick?: (e: MouseEvent) => void; + readonly onHover?: (e: boolean) => void; + readonly children: JSX.Element | false | (JSX.Element | false)[]; +} + +export default function ItemGroup(props: ItemGroupProps): JSX.Element { + const listItem = useRef(null); + + useEffect(() => { + if (listItem.current && props.isSelected) { + scrollIntoViewIfNeeded(listItem.current); + } + }, [props.isSelected, listItem]); + + return ( +
+ props.onHover?.(true)} + onMouseLeave={(): void => props.onHover?.(false)} + onClick={(props.canExpand && props.onClick) || undefined} + /> + {React.Children.map(props.children, child => child)} +
+ ); +} diff --git a/packages/website/src/components/ast/PropertyName.tsx b/packages/website/src/components/ast/PropertyName.tsx index f8768a6c4a2a..36c3a6341534 100644 --- a/packages/website/src/components/ast/PropertyName.tsx +++ b/packages/website/src/components/ast/PropertyName.tsx @@ -1,27 +1,54 @@ -import React, { SyntheticEvent } from 'react'; -import clsx from 'clsx'; +import React, { MouseEvent } from 'react'; import styles from './ASTViewer.module.css'; -export default function PropertyName(props: { - name?: string; - propName?: string; - onClick?: (e: SyntheticEvent) => void; - onMouseEnter?: (e: SyntheticEvent) => void; -}): JSX.Element { - return ( - // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions - +export interface PropertyNameProps { + readonly typeName?: string; + readonly propName?: string; + readonly onClick?: (e: MouseEvent) => void; + readonly onMouseEnter?: (e: MouseEvent) => void; + readonly onMouseLeave?: (e: MouseEvent) => void; +} + +export default function PropertyName(props: PropertyNameProps): JSX.Element { + return props.onClick ? ( + <> {props.propName && ( - + // eslint-disable-next-line jsx-a11y/anchor-is-valid + {props.propName} - + + )} + {props.propName && : } + {props.typeName && ( + // eslint-disable-next-line jsx-a11y/anchor-is-valid + + {props.typeName} + + )} + {props.typeName && } + + ) : ( + <> + {props.propName && ( + {props.propName} )} {props.propName && : } - {props.name && ( - - {props.name} - + {props.typeName && ( + {props.typeName} )} - + {props.typeName && } + ); } diff --git a/packages/website/src/components/ast/PropertyValue.tsx b/packages/website/src/components/ast/PropertyValue.tsx index 48f3ba119a68..4d777b3a4bf4 100644 --- a/packages/website/src/components/ast/PropertyValue.tsx +++ b/packages/website/src/components/ast/PropertyValue.tsx @@ -1,7 +1,12 @@ import React from 'react'; import styles from './ASTViewer.module.css'; +import { objType } from './utils'; -export default function PropertyValue(props: { value: unknown }): JSX.Element { +export interface PropertyValueProps { + readonly value: unknown; +} + +function PropertyValue(props: PropertyValueProps): JSX.Element { if (typeof props.value === 'string') { return ( {JSON.stringify(props.value)} @@ -21,5 +26,7 @@ export default function PropertyValue(props: { value: unknown }): JSX.Element { ); } - return {String(props.value)}; + return {objType(props.value)}; } + +export default PropertyValue; diff --git a/packages/website/src/components/ast/selection.ts b/packages/website/src/components/ast/selection.ts deleted file mode 100644 index 9a882d2bf9af..000000000000 --- a/packages/website/src/components/ast/selection.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { TSESTree } from '@typescript-eslint/website-eslint'; -import type { Position } from './types'; - -export const propsToFilter = ['parent', 'comments', 'tokens', 'loc']; - -export function filterRecord( - values: TSESTree.Node | Record, -): [string, unknown][] { - return Object.entries(values).filter( - item => !propsToFilter.includes(item[0]), - ); -} - -export function isNode(node: unknown): node is TSESTree.Node { - return Boolean( - typeof node === 'object' && node && 'type' in node && 'loc' in node, - ); -} - -export function isWithinNode( - loc: Position, - start: Position, - end: Position, -): boolean { - const canStart = - start.line < loc.line || - (start.line === loc.line && start.column <= loc.column); - const canEnd = - end.line > loc.line || (end.line === loc.line && end.column >= loc.column); - return canStart && canEnd; -} - -export function isRecord(value: unknown): value is Record { - return Boolean( - typeof value === 'object' && value && value.constructor === Object, - ); -} - -export function isEsNode( - value: unknown, -): value is Record & TSESTree.BaseNode { - return isRecord(value) && 'type' in value && 'loc' in value; -} - -export function isInRange( - position: Position | null | undefined, - value: unknown, -): boolean { - return Boolean( - position && - isEsNode(value) && - isWithinNode(position, value.loc.start, value.loc.end), - ); -} - -export function isArrayInRange( - position: Position | null | undefined, - value: unknown, -): boolean { - return Boolean( - position && - Array.isArray(value) && - value.some(item => isInRange(position, item)), - ); -} - -export function hasChildInRange( - position: Position | null | undefined, - value: unknown, -): boolean { - return Boolean( - position && - isEsNode(value) && - filterRecord(value).some( - ([, item]) => - isInRange(position, item) || isArrayInRange(position, item), - ), - ); -} diff --git a/packages/website/src/components/ast/types.ts b/packages/website/src/components/ast/types.ts index 53a565599ab9..8b27865e3428 100644 --- a/packages/website/src/components/ast/types.ts +++ b/packages/website/src/components/ast/types.ts @@ -1,15 +1,37 @@ -import type { TSESTree } from '@typescript-eslint/website-eslint'; +import type { SelectedPosition, SelectedRange } from '../types'; +import { TSESTree } from '@typescript-eslint/website-eslint'; +import Monaco from 'monaco-editor'; -export interface Position { - line: number; - column: number; -} +export type GetNodeNameFn = (data: unknown) => string | undefined; +export type GetTooltipFn = (key: string, data: unknown) => string | undefined; +export type GetRangeFn = (data: unknown) => SelectedRange | undefined; +export type OnSelectNodeFn = (node: SelectedRange | null) => void; +export type FilterPropsFn = (item: [string, unknown]) => boolean; export interface GenericParams { readonly propName?: string; - readonly name?: string; readonly value: V; readonly level: string; - readonly selection?: Position | null; - readonly onSelectNode: (node: TSESTree.Node | null) => void; + readonly selection?: SelectedPosition | null; + readonly onSelectNode?: OnSelectNodeFn; + readonly getNodeName: GetNodeNameFn; + readonly getTooltip?: GetTooltipFn; + readonly filterProps: FilterPropsFn; + readonly getRange: GetRangeFn; + readonly isArray?: boolean; +} + +export interface ASTViewerBaseProps { + readonly value: Record | TSESTree.Node | string; + readonly position?: Monaco.Position | null; + readonly onSelectNode?: OnSelectNodeFn; } + +export interface ASTViewerProps extends ASTViewerBaseProps { + readonly getNodeName: GetNodeNameFn; + readonly getTooltip?: GetTooltipFn; + readonly getRange: GetRangeFn; + readonly filterProps: FilterPropsFn; +} + +export type { SelectedPosition, SelectedRange }; diff --git a/packages/website/src/components/ast/utils.ts b/packages/website/src/components/ast/utils.ts new file mode 100644 index 000000000000..a06436e9c356 --- /dev/null +++ b/packages/website/src/components/ast/utils.ts @@ -0,0 +1,71 @@ +import type { SelectedPosition, SelectedRange } from './types'; +import { GetRangeFn } from './types'; + +export function isWithinRange( + loc: SelectedPosition, + range: SelectedRange, +): boolean { + const canStart = + range.start.line < loc.line || + (range.start.line === loc.line && range.start.column < loc.column); + const canEnd = + range.end.line > loc.line || + (range.end.line === loc.line && range.end.column >= loc.column); + return canStart && canEnd; +} + +export function objType(obj: unknown): string { + const type = Object.prototype.toString.call(obj).slice(8, -1); + // @ts-expect-error: this is correct check + if (type === 'Object' && obj && typeof obj[Symbol.iterator] === 'function') { + return 'Iterable'; + } + + return type; +} + +export function isRecord(value: unknown): value is Record { + return objType(value) === 'Object'; +} + +export function isInRange( + position: SelectedPosition | null | undefined, + value: unknown, + getRange: GetRangeFn, +): boolean { + if (!position) { + return false; + } + const range = getRange(value); + if (!range) { + return false; + } + return isWithinRange(position, range); +} + +export function isArrayInRange( + position: SelectedPosition | null | undefined, + value: unknown, + getRange: GetRangeFn, +): boolean { + return Boolean( + position && + Array.isArray(value) && + value.some(item => isInRange(position, item, getRange)), + ); +} + +export function hasChildInRange( + position: SelectedPosition | null | undefined, + value: [string, unknown][], + getRange: GetRangeFn, +): boolean { + return Boolean( + position && + value.some( + ([, item]) => + isInRange(position, item, getRange) || + isArrayInRange(position, item, getRange), + ), + ); +} diff --git a/packages/website/src/components/editor/LoadedEditor.tsx b/packages/website/src/components/editor/LoadedEditor.tsx index 309da95ad6fb..5a2180ba0fdc 100644 --- a/packages/website/src/components/editor/LoadedEditor.tsx +++ b/packages/website/src/components/editor/LoadedEditor.tsx @@ -11,7 +11,6 @@ import { createProvideCodeActions } from './createProvideCodeActions'; export interface LoadedEditorProps extends CommonEditorProps { readonly main: typeof Monaco; - readonly onSelect: (position: Monaco.Position | null) => void; readonly sandboxInstance: SandboxInstance; readonly webLinter: WebLinter; } @@ -22,7 +21,8 @@ export const LoadedEditor: React.FC = ({ decoration, jsx, main, - onASTChange, + onEsASTChange, + onTsASTChange, onChange, onSelect, rules, @@ -63,7 +63,8 @@ export const LoadedEditor: React.FC = ({ ); } - onASTChange(fatalMessage ?? webLinter.getAst()); + onEsASTChange(fatalMessage ?? webLinter.getAst()); + onTsASTChange(fatalMessage ?? webLinter.getTsAst()); onSelect(sandboxInstance.editor.getPosition()); }, 500), [code, jsx, sandboxInstance, rules, sourceType, webLinter], @@ -149,10 +150,10 @@ export const LoadedEditor: React.FC = ({ ? [ { range: new sandboxInstance.monaco.Range( - decoration.loc.start.line, - decoration.loc.start.column + 1, - decoration.loc.end.line, - decoration.loc.end.column + 1, + decoration.start.line, + decoration.start.column + 1, + decoration.end.line, + decoration.end.column + 1, ), options: { inlineClassName: 'myLineDecoration', diff --git a/packages/website/src/components/editor/types.ts b/packages/website/src/components/editor/types.ts index 6760c57f13d8..56048321473f 100644 --- a/packages/website/src/components/editor/types.ts +++ b/packages/website/src/components/editor/types.ts @@ -1,11 +1,12 @@ import type Monaco from 'monaco-editor'; -import type { ConfigModel } from '../types'; +import type { ConfigModel, SelectedRange } from '../types'; import type { TSESTree } from '@typescript-eslint/website-eslint'; export interface CommonEditorProps extends ConfigModel { readonly darkTheme: boolean; - readonly decoration: TSESTree.Node | null; + readonly decoration: SelectedRange | null; readonly onChange: (value: string) => void; - readonly onASTChange: (value: string | TSESTree.Program) => void; + readonly onTsASTChange: (value: string | Record) => void; + readonly onEsASTChange: (value: string | TSESTree.Program) => void; readonly onSelect: (position: Monaco.Position | null) => void; } diff --git a/packages/website/src/components/hooks/useDebouncedToggle.ts b/packages/website/src/components/hooks/useDebouncedToggle.ts new file mode 100644 index 000000000000..73b655d28e79 --- /dev/null +++ b/packages/website/src/components/hooks/useDebouncedToggle.ts @@ -0,0 +1,26 @@ +import { useRef, useCallback, useState } from 'react'; + +export default function useDebouncedToggle( + value: T, + timeout = 1000, +): [T, (data: T) => void] { + const [state, setState] = useState(value); + const timeoutIdRef = useRef(); + + const update = useCallback( + (data: T) => { + setState(data); + const timeoutId = timeoutIdRef.current; + if (timeoutId) { + timeoutIdRef.current = undefined; + clearTimeout(timeoutId); + } + timeoutIdRef.current = setTimeout(() => { + setState(value); + }, timeout); + }, + [timeoutIdRef], + ); + + return [state, update]; +} diff --git a/packages/website/src/components/hooks/useHashState.ts b/packages/website/src/components/hooks/useHashState.ts index b1263ce04ccb..9c495facc591 100644 --- a/packages/website/src/components/hooks/useHashState.ts +++ b/packages/website/src/components/hooks/useHashState.ts @@ -15,6 +15,16 @@ function readQueryParam(value: string | null, fallback: string): string { : fallback; } +function readShowAST(value: string | null): 'ts' | 'es' | boolean { + switch (value) { + case 'es': + return 'es'; + case 'ts': + return 'ts'; + } + return Boolean(value); +} + const parseStateFromUrl = (hash: string): ConfigModel | undefined => { if (!hash) { return; @@ -25,7 +35,8 @@ const parseStateFromUrl = (hash: string): ConfigModel | undefined => { return { ts: (searchParams.get('ts') ?? process.env.TS_VERSION).trim(), jsx: searchParams.has('jsx'), - showAST: searchParams.has('showAST'), + showAST: + searchParams.has('showAST') && readShowAST(searchParams.get('showAST')), sourceType: searchParams.has('sourceType') && searchParams.get('sourceType') === 'script' @@ -81,14 +92,14 @@ function useHashState( initialState: ConfigModel, ): [ConfigModel, (cfg: Partial) => void] { const [hash, setHash] = useState(window.location.hash.slice(1)); - const [state, setState] = useState({ + const [state, setState] = useState(() => ({ ...initialState, ...parseStateFromUrl(window.location.hash.slice(1)), - }); - const [tmpState, setTmpState] = useState>({ + })); + const [tmpState, setTmpState] = useState>(() => ({ ...initialState, ...parseStateFromUrl(window.location.hash.slice(1)), - }); + })); useEffect(() => { const newHash = window.location.hash.slice(1); diff --git a/packages/website/src/components/inputs/Dropdown.tsx b/packages/website/src/components/inputs/Dropdown.tsx index 3a298eb5910f..929f4bc6bbbc 100644 --- a/packages/website/src/components/inputs/Dropdown.tsx +++ b/packages/website/src/components/inputs/Dropdown.tsx @@ -2,27 +2,45 @@ import React from 'react'; import styles from '../OptionsSelector.module.css'; import clsx from 'clsx'; -export interface DropdownProps { - readonly onChange: (value: string) => void; - readonly options: string[]; - readonly value: string | undefined; +export interface DropdownOption { + readonly value: T; + readonly label: string; +} + +export interface DropdownProps { + readonly onChange: (value: T) => void; + readonly options: readonly (DropdownOption | T)[]; + readonly value: T | undefined; readonly name: string; readonly className?: string; } -function Dropdown(props: DropdownProps): JSX.Element { +function Dropdown( + props: DropdownProps, +): JSX.Element { + const options: DropdownOption[] = props.options.map(option => + typeof option !== 'object' + ? { label: String(option), value: option } + : option, + ); + return ( diff --git a/packages/website/src/components/inputs/Tooltip.module.css b/packages/website/src/components/inputs/Tooltip.module.css index 95895ffc6092..2d5303e01105 100644 --- a/packages/website/src/components/inputs/Tooltip.module.css +++ b/packages/website/src/components/inputs/Tooltip.module.css @@ -1,34 +1,89 @@ +:root { + --tooltip-bg-color: var(--ifm-color-emphasis-200); + --tooltip-text-color: var(--ifm-color-emphasis-900); + --tooltip-arrow-size: 0.3125rem; +} + .tooltip { position: relative; display: inline-block; } -.tooltipText { - visibility: hidden; - background-color: var(--ifm-color-emphasis-200); - color: var(--ifm-color-emphasis-900); - text-align: center; +.tooltip.hover { + text-decoration: underline; + cursor: pointer; +} + +.tooltip:after { + background-color: var(--tooltip-bg-color); border-radius: 6px; + color: var(--tooltip-text-color); + content: attr(aria-label); padding: 0.2rem 1rem; - margin-right: 0.3rem; - position: absolute; - z-index: 1; - top: -5px; - right: 110%; + text-indent: 0; + text-shadow: none; + white-space: normal; + word-wrap: break-word; + z-index: 10; + min-width: 6.25rem; + max-width: 25rem; + visibility: hidden; } -.tooltipText::after { +.tooltip:before { content: ''; + z-index: 11; + border: var(--tooltip-arrow-size) solid transparent; + height: 0; + width: 0; + visibility: hidden; +} + +.tooltip:after, +.tooltip:before { + box-sizing: border-box; + opacity: 0; + pointer-events: none; position: absolute; - top: 50%; - left: 100%; - margin-top: -5px; - border-width: 5px; - border-style: solid; - border-color: transparent transparent transparent - var(--ifm-color-emphasis-200); + transition: opacity 120ms ease-out 120ms; } -.tooltip.tooltipActive .tooltipText { +.tooltip.hover:hover:before, +.tooltip.hover:hover:after, +.tooltip.visible:before, +.tooltip.visible:after { visibility: visible; + opacity: 100%; +} + +.tooltipLeft:after { + margin-right: calc(var(--tooltip-arrow-size) * 2); +} + +.tooltipLeft:before { + border-left-color: var(--tooltip-bg-color); +} + +.tooltipLeft:after, +.tooltipLeft:before { + right: calc(100% - var(--tooltip-arrow-size) / 2); + top: 50%; + transform-origin: left; + transform: translateY(-50%); +} + +.tooltipRight:after { + margin-left: calc(var(--tooltip-arrow-size) * 2); +} + +.tooltipRight:before { + border-right-color: var(--tooltip-bg-color); +} + +.tooltipRight:after, +.tooltipRight:before { + left: calc(100% - var(--tooltip-arrow-size) / 2); + top: 50%; + transform-origin: right; + transform: translateY(-50%); } diff --git a/packages/website/src/components/inputs/Tooltip.tsx b/packages/website/src/components/inputs/Tooltip.tsx index 5a0542ad6048..5756321e0719 100644 --- a/packages/website/src/components/inputs/Tooltip.tsx +++ b/packages/website/src/components/inputs/Tooltip.tsx @@ -1,28 +1,28 @@ -import React, { useEffect } from 'react'; +import React from 'react'; import styles from './Tooltip.module.css'; import clsx from 'clsx'; export interface TooltipProps { readonly children: JSX.Element | (JSX.Element | false)[]; readonly text: string; + readonly position?: 'left' | 'right'; readonly open?: boolean; - readonly close: (status: boolean) => void; + readonly hover?: boolean; } function Tooltip(props: TooltipProps): JSX.Element { - useEffect(() => { - if (props.open) { - setTimeout(() => { - props.close(false); - }, 1000); - } - }, [props.open]); - return ( -
+ {React.Children.map(props.children, child => child)} - {props.text} -
+ ); } diff --git a/packages/website/src/components/lib/shallowEqual.ts b/packages/website/src/components/lib/shallowEqual.ts index 2f34444c5874..f1e26ede82d5 100644 --- a/packages/website/src/components/lib/shallowEqual.ts +++ b/packages/website/src/components/lib/shallowEqual.ts @@ -1,8 +1,6 @@ -import type { ConfigModel } from '@site/src/components/types'; - export function shallowEqual( - object1: Record | ConfigModel | undefined, - object2: Record | ConfigModel | undefined, + object1: object | undefined | null, + object2: object | undefined | null, ): boolean { if (object1 === object2) { return true; diff --git a/packages/website/src/components/types.ts b/packages/website/src/components/types.ts index 4d5d032db0fc..7830baa224c5 100644 --- a/packages/website/src/components/types.ts +++ b/packages/website/src/components/types.ts @@ -42,5 +42,15 @@ export interface ConfigModel { tsConfig?: CompilerFlags; code: string; ts: string; - showAST?: boolean; + showAST?: boolean | 'ts' | 'es'; +} + +export interface SelectedPosition { + line: number; + column: number; +} + +export interface SelectedRange { + start: SelectedPosition; + end: SelectedPosition; } From 9c3befbbcc9a0f7ed71dd57d9049d0138100a61c Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 13 Dec 2021 18:02:02 +0000 Subject: [PATCH 19/19] chore: publish v5.7.0 --- CHANGELOG.md | 18 ++++++++++++++++++ lerna.json | 2 +- packages/ast-spec/CHANGELOG.md | 8 ++++++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-internal/package.json | 6 +++--- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 13 +++++++++++++ packages/eslint-plugin/package.json | 6 +++--- packages/experimental-utils/CHANGELOG.md | 8 ++++++++ packages/experimental-utils/package.json | 8 ++++---- packages/parser/CHANGELOG.md | 8 ++++++++ packages/parser/package.json | 10 +++++----- packages/scope-manager/CHANGELOG.md | 8 ++++++++ packages/scope-manager/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 8 ++++++++ packages/shared-fixtures/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 11 +++++++++++ packages/typescript-estree/package.json | 8 ++++---- packages/visitor-keys/CHANGELOG.md | 8 ++++++++ packages/visitor-keys/package.json | 4 ++-- packages/website-eslint/CHANGELOG.md | 8 ++++++++ packages/website-eslint/package.json | 16 ++++++++-------- packages/website/CHANGELOG.md | 8 ++++++++ packages/website/package.json | 4 ++-- 28 files changed, 172 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f691a2cb4e..1ad67b6f2ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + + +### Bug Fixes + +* **typescript-estree:** type-only regression for consumers not yet on TS 4.5 ([#4272](https://github.com/typescript-eslint/typescript-eslint/issues/4272)) ([550b61e](https://github.com/typescript-eslint/typescript-eslint/commit/550b61ee1096113b234bf035dd267ba385809961)) + + +### Features + +* **eslint-plugin:** [consistent-type-exports] support TS4.5 inline export specifiers ([#4236](https://github.com/typescript-eslint/typescript-eslint/issues/4236)) ([be4d976](https://github.com/typescript-eslint/typescript-eslint/commit/be4d976215614cc032730ae596d2f6e47df67730)) +* **eslint-plugin:** [consistent-type-imports] support TS4.5 inline import specifiers ([#4237](https://github.com/typescript-eslint/typescript-eslint/issues/4237)) ([f61af7c](https://github.com/typescript-eslint/typescript-eslint/commit/f61af7c53cca52f81e77b4334c7d6ad100609af6)) +* **eslint-plugin:** [no-shadow] support TS4.5 inline import specifiers ([#4239](https://github.com/typescript-eslint/typescript-eslint/issues/4239)) ([96b7e8e](https://github.com/typescript-eslint/typescript-eslint/commit/96b7e8ee0f5280cab50a7205ae592e1d983a111a)) + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) diff --git a/lerna.json b/lerna.json index f209467054f7..44f55debd4e9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.6.0", + "version": "5.7.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 5ef2c3ca1c23..22ead3c54042 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/ast-spec diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 890f2587479a..4aa03bf7f5ca 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.6.0", + "version": "5.7.0", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index ba62929231d4..787bf9c4b22a 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 8e78f4a4e0a0..8376611d7b44 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "5.6.0", + "version": "5.7.0", "private": true, "main": "dist/index.js", "scripts": { @@ -14,8 +14,8 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "5.6.0", - "@typescript-eslint/scope-manager": "5.6.0", + "@typescript-eslint/experimental-utils": "5.7.0", + "@typescript-eslint/scope-manager": "5.7.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 8b1e167ba632..9ed913a039e5 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index fa70b87afe38..26ac45eb98a6 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "5.6.0", + "version": "5.7.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.6.0", + "@typescript-eslint/experimental-utils": "5.7.0", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.6.0" + "@typescript-eslint/parser": "5.7.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 510c4a30b394..0d458d044130 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + + +### Features + +* **eslint-plugin:** [consistent-type-exports] support TS4.5 inline export specifiers ([#4236](https://github.com/typescript-eslint/typescript-eslint/issues/4236)) ([be4d976](https://github.com/typescript-eslint/typescript-eslint/commit/be4d976215614cc032730ae596d2f6e47df67730)) +* **eslint-plugin:** [consistent-type-imports] support TS4.5 inline import specifiers ([#4237](https://github.com/typescript-eslint/typescript-eslint/issues/4237)) ([f61af7c](https://github.com/typescript-eslint/typescript-eslint/commit/f61af7c53cca52f81e77b4334c7d6ad100609af6)) +* **eslint-plugin:** [no-shadow] support TS4.5 inline import specifiers ([#4239](https://github.com/typescript-eslint/typescript-eslint/issues/4239)) ([96b7e8e](https://github.com/typescript-eslint/typescript-eslint/commit/96b7e8ee0f5280cab50a7205ae592e1d983a111a)) + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 986b27b213b7..fccfe21002c0 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.6.0", + "version": "5.7.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,8 +44,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.6.0", - "@typescript-eslint/scope-manager": "5.6.0", + "@typescript-eslint/experimental-utils": "5.7.0", + "@typescript-eslint/scope-manager": "5.7.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index ccf223b31713..9ecdc0ad10b3 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/experimental-utils diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 1a165fb9ba43..e1e4b6388e0e 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.6.0", + "version": "5.7.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.6.0", - "@typescript-eslint/types": "5.6.0", - "@typescript-eslint/typescript-estree": "5.6.0", + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 1d9a7c917f2f..888d23ecb97d 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index 0769ff138329..74f8a1f5f5e8 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.6.0", + "version": "5.7.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,14 +44,14 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.6.0", - "@typescript-eslint/types": "5.6.0", - "@typescript-eslint/typescript-estree": "5.6.0", + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", "debug": "^4.3.2" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/experimental-utils": "5.6.0", + "@typescript-eslint/experimental-utils": "5.7.0", "glob": "*", "typescript": "*" }, diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index c9bf1a6239e8..f0fcf5621994 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 32f1f93ddbc4..567736bbd43a 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.6.0", + "version": "5.7.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.6.0", - "@typescript-eslint/visitor-keys": "5.6.0" + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.6.0", + "@typescript-eslint/typescript-estree": "5.7.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index d606aa64a4fc..be86576af0d0 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 8b3911ffb2a7..1301d9198add 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "5.6.0", + "version": "5.7.0", "private": true } diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index e5369be70664..4c9c22bda905 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) diff --git a/packages/types/package.json b/packages/types/package.json index 78a5dbde545e..4d4c491ed8c9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.6.0", + "version": "5.7.0", "description": "Types for the TypeScript-ESTree AST spec", "keywords": [ "eslint", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 31262c8ff976..9e5fee047125 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + + +### Bug Fixes + +* **typescript-estree:** type-only regression for consumers not yet on TS 4.5 ([#4272](https://github.com/typescript-eslint/typescript-eslint/issues/4272)) ([550b61e](https://github.com/typescript-eslint/typescript-eslint/commit/550b61ee1096113b234bf035dd267ba385809961)) + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 88c8bbd3db88..83ada176fcd2 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.6.0", + "version": "5.7.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -41,8 +41,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.6.0", - "@typescript-eslint/visitor-keys": "5.6.0", + "@typescript-eslint/types": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "5.6.0", + "@typescript-eslint/shared-fixtures": "5.7.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 255b818900e8..727a578210c4 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/visitor-keys diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index d8209b3f273e..1d4db5768910 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.6.0", + "version": "5.7.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.6.0", + "@typescript-eslint/types": "5.7.0", "eslint-visitor-keys": "^3.0.0" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index 5053ccf35a06..cb87dfcf918e 100644 --- a/packages/website-eslint/CHANGELOG.md +++ b/packages/website-eslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package @typescript-eslint/website-eslint + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/website-eslint diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 70e488faa0eb..532f9b68e13d 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.6.0", + "version": "5.7.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,19 +16,19 @@ "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/experimental-utils": "5.6.0", - "@typescript-eslint/types": "5.6.0" + "@typescript-eslint/experimental-utils": "5.7.0", + "@typescript-eslint/types": "5.7.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.6", "@rollup/pluginutils": "^4.1.1", - "@typescript-eslint/eslint-plugin": "5.6.0", - "@typescript-eslint/parser": "5.6.0", - "@typescript-eslint/scope-manager": "5.6.0", - "@typescript-eslint/typescript-estree": "5.6.0", - "@typescript-eslint/visitor-keys": "5.6.0", + "@typescript-eslint/eslint-plugin": "5.7.0", + "@typescript-eslint/parser": "5.7.0", + "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/typescript-estree": "5.7.0", + "@typescript-eslint/visitor-keys": "5.7.0", "eslint": "*", "rollup": "^2.59.0", "semver": "^7.3.5" diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index 029b67b024a6..7f0d2d22796d 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) + +**Note:** Version bump only for package website + + + + + # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) diff --git a/packages/website/package.json b/packages/website/package.json index ee2a67eb7edd..07e1f1d77954 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "5.6.0", + "version": "5.7.0", "private": true, "scripts": { "build": "docusaurus build", @@ -21,7 +21,7 @@ "@docusaurus/theme-classic": "^2.0.0-beta.9", "@docusaurus/theme-search-algolia": "^2.0.0-beta.9", "@mdx-js/react": "1.6.22", - "@typescript-eslint/website-eslint": "5.6.0", + "@typescript-eslint/website-eslint": "5.7.0", "clsx": "^1.1.1", "eslint": "*", "konamimojisplosion": "^0.5.1",