diff --git a/CHANGELOG.md b/CHANGELOG.md index e7aec1e47475..d2f5efe6f206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + + +### Bug Fixes + +* **eslint-plugin:** [unified-signatures] allow overloads with different named and different number of parameters ([#6877](https://github.com/typescript-eslint/typescript-eslint/issues/6877)) ([939d665](https://github.com/typescript-eslint/typescript-eslint/commit/939d6656ebcb94fab048a08d719b3e77362ab5b4)) +* update getLib for new TypeScript targets ES2021, ES2022 ([#6782](https://github.com/typescript-eslint/typescript-eslint/issues/6782)) ([1c04664](https://github.com/typescript-eslint/typescript-eslint/commit/1c0466414300f338c6c4111f8d1eac0c3e6a8983)) + + +### Features + +* **eslint-plugin:** [no-unsafe-enum-comparison] add rule ([#6107](https://github.com/typescript-eslint/typescript-eslint/issues/6107)) ([915f9c2](https://github.com/typescript-eslint/typescript-eslint/commit/915f9c2dc8934eef491a672786ec9f016f3658ba)) + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) diff --git a/docs/contributing/Pull_Requests.mdx b/docs/contributing/Pull_Requests.mdx index 36059661b4b1..f966b1dacc0f 100644 --- a/docs/contributing/Pull_Requests.mdx +++ b/docs/contributing/Pull_Requests.mdx @@ -81,3 +81,9 @@ You can [resolve conversations](https://docs.github.com/en/pull-requests/collabo Once you've addressed all our feedback by making code changes and/or started a followup discussion, [re-request review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review) from each maintainer whose feedback you addressed. Once the feedback is addressed, and the PR is approved, we'll ensure the branch is up to date with `main`, and merge it for you. + +### Asking Questions + +If you need help and/or have a question, posting a comment in the PR is a great way to do so. +There's no need to tag anybody individually. +One of us will drop by and help when we can. diff --git a/docs/linting/typed-linting/Monorepos.mdx b/docs/linting/typed-linting/Monorepos.mdx index 9d0d67e331fa..dd94b933317d 100644 --- a/docs/linting/typed-linting/Monorepos.mdx +++ b/docs/linting/typed-linting/Monorepos.mdx @@ -99,7 +99,7 @@ See [#1192](https://github.com/typescript-eslint/typescript-eslint/issues/1192) If you do run into an OOM, please comment on the above issue and let us know about your repo - the more information we have, the better. As an interim workaround, consider one of the following: -- Switching to one root `tsconfig.eslint.json` (see below) +- Switching to one root `tsconfig.eslint.json` (see [One root `tsconfig.json`](#one-root-tsconfigjson)) - Using a shell script to only lint one package at a time, using your existing config above. ## Troubleshooting diff --git a/lerna.json b/lerna.json index 669662f01fa0..b1a61146c06d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.57.1", + "version": "5.58.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index bf0b744cb78e..cbaf1c86df16 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **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 548dbfd5b8ec..4edcd9be07d6 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.57.1", + "version": "5.58.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index e78c129d4e9b..50d3e6a9ca9e 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **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 1b50eef76646..95fee733b915 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.57.1", + "version": "5.58.0", "private": true, "main": "dist/index.js", "scripts": { @@ -14,9 +14,9 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/type-utils": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/scope-manager": "5.58.0", + "@typescript-eslint/type-utils": "5.58.0", + "@typescript-eslint/utils": "5.58.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 14717ad06d81..99a27a21b918 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **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 4d59cc6359b0..1ba3c2e89e0c 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.57.1", + "version": "5.58.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "ESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.57.1" + "@typescript-eslint/utils": "5.58.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0", @@ -47,6 +47,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.57.1" + "@typescript-eslint/parser": "5.58.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 92f8ab3a9f91..31adaf803def 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + + +### Bug Fixes + +* **eslint-plugin:** [unified-signatures] allow overloads with different named and different number of parameters ([#6877](https://github.com/typescript-eslint/typescript-eslint/issues/6877)) ([939d665](https://github.com/typescript-eslint/typescript-eslint/commit/939d6656ebcb94fab048a08d719b3e77362ab5b4)) + + +### Features + +* **eslint-plugin:** [no-unsafe-enum-comparison] add rule ([#6107](https://github.com/typescript-eslint/typescript-eslint/issues/6107)) ([915f9c2](https://github.com/typescript-eslint/typescript-eslint/commit/915f9c2dc8934eef491a672786ec9f016f3658ba)) + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md b/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md new file mode 100644 index 000000000000..6931d46d1b36 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md @@ -0,0 +1,75 @@ +--- +description: 'Disallow comparing an enum value with a non-enum value.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-enum-comparison** for documentation. + +The TypeScript compiler can be surprisingly lenient when working with enums. +For example, it will allow you to compare enum values against numbers even though they might not have any type overlap: + +```ts +enum Fruit { + Apple, + Banana, +} + +declare let fruit: Fruit; + +fruit === 999; // No error +``` + +This rule flags when an enum typed value is compared to a non-enum `number`. + + + +### ❌ Incorrect + +```ts +enum Fruit { + Apple, +} + +declare let fruit: Fruit; + +fruit === 999; +``` + +```ts +enum Vegetable { + Asparagus = 'asparagus', +} + +declare let vegetable: Vegetable; + +vegetable === 'asparagus'; +``` + +### ✅ Correct + +```ts +enum Fruit { + Apple, +} + +declare let fruit: Fruit; + +fruit === Fruit.Banana; +``` + +```ts +enum Vegetable { + Asparagus = 'asparagus', +} + +declare let vegetable: Vegetable; + +vegetable === Vegetable.Asparagus; +``` + + + +## When Not to Use It + +If you don't mind number and/or literal string constants being compared against enums, you likely don't need this rule. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index f453e0e09f83..e2f586f6981b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.57.1", + "version": "5.58.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -45,9 +45,9 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/type-utils": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/scope-manager": "5.58.0", + "@typescript-eslint/type-utils": "5.58.0", + "@typescript-eslint/utils": "5.58.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index e712d0b6f290..777cf069827e 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -116,6 +116,7 @@ export = { '@typescript-eslint/no-unsafe-assignment': 'error', '@typescript-eslint/no-unsafe-call': 'error', '@typescript-eslint/no-unsafe-declaration-merging': 'error', + '@typescript-eslint/no-unsafe-enum-comparison': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', 'no-unused-expressions': 'off', diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index c63b4173452b..26b71c931b00 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -29,6 +29,7 @@ export = { '@typescript-eslint/no-unnecessary-condition': 'warn', '@typescript-eslint/no-unnecessary-type-arguments': 'warn', '@typescript-eslint/no-unsafe-declaration-merging': 'warn', + '@typescript-eslint/no-unsafe-enum-comparison': 'warn', 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', diff --git a/packages/eslint-plugin/src/rules/enum-utils/shared.ts b/packages/eslint-plugin/src/rules/enum-utils/shared.ts new file mode 100644 index 000000000000..6a3349143aa6 --- /dev/null +++ b/packages/eslint-plugin/src/rules/enum-utils/shared.ts @@ -0,0 +1,40 @@ +import * as tsutils from 'tsutils'; +import * as ts from 'typescript'; + +import * as util from '../../util'; + +/* + * If passed an enum member, returns the type of the parent. Otherwise, + * returns itself. + * + * For example: + * - `Fruit` --> `Fruit` + * - `Fruit.Apple` --> `Fruit` + */ +function getBaseEnumType(typeChecker: ts.TypeChecker, type: ts.Type): ts.Type { + const symbol = type.getSymbol()!; + if (!tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.EnumMember)) { + return type; + } + + return typeChecker.getTypeAtLocation(symbol.valueDeclaration!.parent); +} + +/** + * A type can have 0 or more enum types. For example: + * - 123 --> [] + * - {} --> [] + * - Fruit.Apple --> [Fruit] + * - Fruit.Apple | Vegetable.Lettuce --> [Fruit, Vegetable] + * - Fruit.Apple | Vegetable.Lettuce | 123 --> [Fruit, Vegetable] + * - T extends Fruit --> [Fruit] + */ +export function getEnumTypes( + typeChecker: ts.TypeChecker, + type: ts.Type, +): ts.Type[] { + return tsutils + .unionTypeParts(type) + .filter(subType => util.isTypeFlagSet(subType, ts.TypeFlags.EnumLiteral)) + .map(type => getBaseEnumType(typeChecker, type)); +} diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 88f6d8c2cb82..405514edd1f0 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -85,6 +85,7 @@ import noUnsafeArgument from './no-unsafe-argument'; import noUnsafeAssignment from './no-unsafe-assignment'; import noUnsafeCall from './no-unsafe-call'; import noUnsafeDeclarationMerging from './no-unsafe-declaration-merging'; +import noUnsafeEnumComparison from './no-unsafe-enum-comparison'; import noUnsafeMemberAccess from './no-unsafe-member-access'; import noUnsafeReturn from './no-unsafe-return'; import noUnusedExpressions from './no-unused-expressions'; @@ -222,6 +223,7 @@ export default { 'no-unsafe-assignment': noUnsafeAssignment, 'no-unsafe-call': noUnsafeCall, 'no-unsafe-declaration-merging': noUnsafeDeclarationMerging, + 'no-unsafe-enum-comparison': noUnsafeEnumComparison, 'no-unsafe-member-access': noUnsafeMemberAccess, 'no-unsafe-return': noUnsafeReturn, 'no-unused-expressions': noUnusedExpressions, diff --git a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts new file mode 100644 index 000000000000..ac7a64727bcb --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts @@ -0,0 +1,121 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import * as tsutils from 'tsutils'; +import * as ts from 'typescript'; + +import * as util from '../util'; +import { getEnumTypes } from './enum-utils/shared'; + +/** + * @returns Whether the right type is an unsafe comparison against any left type. + */ +function typeViolates(leftTypeParts: ts.Type[], right: ts.Type): boolean { + const leftValueKinds = new Set(leftTypeParts.map(getEnumValueType)); + + return ( + (leftValueKinds.has(ts.TypeFlags.Number) && + tsutils.isTypeFlagSet( + right, + ts.TypeFlags.Number | ts.TypeFlags.NumberLike, + )) || + (leftValueKinds.has(ts.TypeFlags.String) && + tsutils.isTypeFlagSet( + right, + ts.TypeFlags.String | ts.TypeFlags.StringLike, + )) + ); +} + +/** + * @returns What type a type's enum value is (number or string), if either. + */ +function getEnumValueType(type: ts.Type): ts.TypeFlags | undefined { + return util.isTypeFlagSet(type, ts.TypeFlags.EnumLike) + ? util.isTypeFlagSet(type, ts.TypeFlags.NumberLiteral) + ? ts.TypeFlags.Number + : ts.TypeFlags.String + : undefined; +} + +export default util.createRule({ + name: 'no-unsafe-enum-comparison', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow comparing an enum value with a non-enum value', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + mismatched: + 'The two values in this comparison do not have a shared enum type.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const typeChecker = parserServices.program.getTypeChecker(); + + function getTypeFromNode(node: TSESTree.Node): ts.Type { + return typeChecker.getTypeAtLocation( + parserServices.esTreeNodeToTSNodeMap.get(node), + ); + } + + return { + 'BinaryExpression[operator=/=|<|>/]'( + node: TSESTree.BinaryExpression, + ): void { + const left = getTypeFromNode(node.left); + const right = getTypeFromNode(node.right); + + // Allow comparisons that don't have anything to do with enums: + // + // ```ts + // 1 === 2; + // ``` + const leftEnumTypes = getEnumTypes(typeChecker, left); + const rightEnumTypes = new Set(getEnumTypes(typeChecker, right)); + if (leftEnumTypes.length === 0 && rightEnumTypes.size === 0) { + return; + } + + // Allow comparisons that share an enum type: + // + // ```ts + // Fruit.Apple === Fruit.Banana; + // ``` + for (const leftEnumType of leftEnumTypes) { + if (rightEnumTypes.has(leftEnumType)) { + return; + } + } + + const leftTypeParts = tsutils.unionTypeParts(left); + const rightTypeParts = tsutils.unionTypeParts(right); + + // If a type exists in both sides, we consider this comparison safe: + // + // ```ts + // declare const fruit: Fruit.Apple | 0; + // fruit === 0; + // ``` + for (const leftTypePart of leftTypeParts) { + if (rightTypeParts.includes(leftTypePart)) { + return; + } + } + + if ( + typeViolates(leftTypeParts, right) || + typeViolates(rightTypeParts, left) + ) { + context.report({ + messageId: 'mismatched', + node, + }); + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index 3e5d8fefb07e..b387450801fd 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -212,10 +212,7 @@ export default util.createRule({ const bTypeParams = b.typeParameters !== undefined ? b.typeParameters.params : undefined; - if ( - ignoreDifferentlyNamedParameters && - a.params.length === b.params.length - ) { + if (ignoreDifferentlyNamedParameters) { for (let i = 0; i < a.params.length; i += 1) { if ( a.params[i].type === b.params[i].type && diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts new file mode 100644 index 000000000000..5e84c983076c --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -0,0 +1,553 @@ +import rule from '../../src/rules/no-unsafe-enum-comparison'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; + +const rootDir = getFixturesRootDir(); + +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 2015, + tsconfigRootDir: rootDir, + project: './tsconfig.json', + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('strict-enums-comparison', rule, { + valid: [ + "'a' > 'b';", + "'a' < 'b';", + "'a' == 'b';", + "'a' === 'b';", + '1 > 2;', + '1 < 2;', + '1 == 2;', + '1 === 2;', + ` + enum Fruit { + Apple, + } + Fruit.Apple === ({} as any); + `, + ` + enum Fruit { + Apple, + } + Fruit.Apple === undefined; + `, + ` + enum Fruit { + Apple, + } + Fruit.Apple === null; + `, + ` + enum Fruit { + Apple, + } + declare const fruit: Fruit | -1; + fruit === -1; + `, + ` + enum Fruit { + Apple, + } + declare const fruit: Fruit | number; + fruit === -1; + `, + ` + enum Fruit { + Apple, + } + declare const fruit: Fruit | 'apple'; + fruit === 'apple'; + `, + ` + enum Fruit { + Apple, + } + declare const fruit: Fruit | string; + fruit === 'apple'; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | 'apple'; + fruit === 'apple'; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | string; + fruit === 'apple'; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | 0; + fruit === 0; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | number; + fruit === 0; + `, + ` + enum Fruit { + Apple, + } + declare const fruit: Fruit | 'apple'; + fruit === Math.random() > 0.5 ? 'apple' : Fruit.Apple; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | 'apple'; + fruit === Math.random() > 0.5 ? 'apple' : Fruit.Apple; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | string; + fruit === Math.random() > 0.5 ? 'apple' : Fruit.Apple; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | 0; + fruit === Math.random() > 0.5 ? 0 : Fruit.Apple; + `, + ` + enum Fruit { + Apple = 'apple', + } + declare const fruit: Fruit | number; + fruit === Math.random() > 0.5 ? 0 : Fruit.Apple; + `, + ` + enum Fruit { + Apple, + Banana, + } + Fruit.Apple === Fruit.Banana; + `, + ` + enum Fruit { + Apple = 0, + Banana = 1, + } + Fruit.Apple === Fruit.Banana; + `, + ` + enum Fruit { + Apple = 'apple', + Banana = 'banana', + } + Fruit.Apple === Fruit.Banana; + `, + ` + enum Fruit { + Apple, + Banana, + } + const fruit = Fruit.Apple; + fruit === Fruit.Banana; + `, + ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + const vegetable = Vegetable.Asparagus; + vegetable === Vegetable.Beet; + `, + ` + enum Fruit { + Apple, + Banana, + Cherry, + } + const fruit1 = Fruit.Apple; + const fruit2 = Fruit.Banana; + fruit1 === fruit2; + `, + ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + const vegetable1 = Vegetable.Asparagus; + const vegetable2 = Vegetable.Beet; + vegetable1 === vegetable2; + `, + ` + enum Fruit { + Apple, + Banana, + Cherry, + } + enum Fruit2 { + Apple2, + Banana2, + Cherry2, + } + declare const left: number | Fruit; + declare const right: number | Fruit2; + left === right; + `, + ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + enum Vegetable2 { + Asparagus2 = 'asparagus2', + Beet2 = 'beet2', + Celery2 = 'celery2', + } + declare const left: string | Vegetable; + declare const right: string | Vegetable2; + left === right; + `, + ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + type WeirdString = string & { __someBrand: void }; + declare const weirdString: WeirdString; + Vegetable.Asparagus === weirdString; + `, + ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + const foo = {}; + const vegetable = Vegetable.Asparagus; + vegetable in foo; + `, + ` + enum Fruit { + Apple, + Banana, + Cherry, + } + declare const fruitOrBoolean: Fruit | boolean; + fruitOrBoolean === true; + `, + ` + enum Str { + A = 'a', + } + enum Num { + B = 1, + } + enum Mixed { + A = 'a', + B = 1, + } + + declare const str: Str; + declare const strOrString: Str | string; + + declare const num: Num; + declare const numOrNumber: Num | number; + + declare const mixed: Mixed; + declare const mixedOrStringOrNumber: Mixed | string | number; + + function someFunction() {} + + // following are all ignored due to the presence of "| string" or "| number" + strOrString === 'a'; + numOrNumber === 1; + mixedOrStringOrNumber === 'a'; + mixedOrStringOrNumber === 1; + + // following are all ignored because the value can never be an enum value + str === 1; + num === 'a'; + str === {}; + num === {}; + mixed === {}; + str === true; + num === true; + mixed === true; + str === someFunction; + num === someFunction; + mixed === someFunction; + `, + ], + invalid: [ + { + code: ` + enum Fruit { + Apple, + } + Fruit.Apple < 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + } + Fruit.Apple > 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + } + Fruit.Apple == 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + } + Fruit.Apple === 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + } + Fruit.Apple != 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + } + Fruit.Apple !== 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple = 0, + Banana = 'banana', + } + Fruit.Apple === 0; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple = 0, + Banana = 'banana', + } + Fruit.Banana === ''; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + Vegetable.Asparagus === 'beet'; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + Banana, + Cherry, + } + 1 === Fruit.Apple; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + 'beet' === Vegetable.Asparagus; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + Banana, + Cherry, + } + const fruit = Fruit.Apple; + fruit === 1; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + const vegetable = Vegetable.Asparagus; + vegetable === 'beet'; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Fruit { + Apple, + Banana, + Cherry, + } + const fruit = Fruit.Apple; + 1 === fruit; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + const vegetable = Vegetable.Asparagus; + 'beet' === vegetable; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: + 'enum Fruit { Apple, Banana, Cherry }' + + `enum Fruit2 { + Apple2, + Banana2, + Cherry2, +} + Fruit.Apple === Fruit2.Apple2; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + enum Vegetable2 { + Asparagus2 = 'asparagus2', + Beet2 = 'beet2', + Celery2 = 'celery2', + } + Vegetable.Asparagus === Vegetable2.Asparagus2; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: + 'enum Fruit { Apple, Banana, Cherry }' + + `enum Fruit2 { + Apple2, + Banana2, + Cherry2, +} + const fruit = Fruit.Apple; + fruit === Fruit2.Apple2; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Vegetable { + Asparagus = 'asparagus', + Beet = 'beet', + Celery = 'celery', + } + enum Vegetable2 { + Asparagus2 = 'asparagus2', + Beet2 = 'beet2', + Celery2 = 'celery2', + } + const vegetable = Vegetable.Asparagus; + vegetable === Vegetable2.Asparagus2; + `, + errors: [{ messageId: 'mismatched' }], + }, + { + code: ` + enum Str { + A = 'a', + } + enum Num { + B = 1, + } + enum Mixed { + A = 'a', + B = 1, + } + + declare const str: Str; + declare const num: Num; + declare const mixed: Mixed; + + // following are all errors because the value might be an enum value + str === 'a'; + num === 1; + mixed === 'a'; + mixed === 1; + `, + errors: [ + { messageId: 'mismatched' }, + { messageId: 'mismatched' }, + { messageId: 'mismatched' }, + { messageId: 'mismatched' }, + ], + }, + { + code: ` + enum Fruit { + Apple = 'apple', + } + type __String = + | (string & { __escapedIdentifier: void }) + | (void & { __escapedIdentifier: void }) + | Fruit; + declare const weirdString: __String; + weirdString === 'someArbitraryValue'; + `, + errors: [{ messageId: 'mismatched' }], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts index 9bd8a07e9975..73f773dc42d3 100644 --- a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts @@ -169,6 +169,14 @@ function f(a: number | string): void {} }, { code: ` +function f(m: number): void; +function f(v: number, u: string): void; +function f(v: number, u?: string): void {} + `, + options: [{ ignoreDifferentlyNamedParameters: true }], + }, + { + code: ` function f(a: boolean, ...c: number[]): void; function f(a: boolean, ...d: string[]): void; function f(a: boolean, ...c: (number | string)[]): void {} diff --git a/packages/eslint-plugin/typings/typescript.d.ts b/packages/eslint-plugin/typings/typescript.d.ts index 0f0b38a5ba6f..e08a8fb42267 100644 --- a/packages/eslint-plugin/typings/typescript.d.ts +++ b/packages/eslint-plugin/typings/typescript.d.ts @@ -4,6 +4,8 @@ declare module 'typescript' { interface TypeChecker { // internal TS APIs + getContextualTypeForArgumentAtIndex(node: Node, argIndex: number): Type; + /** * @returns `true` if the given type is an array type: * - `Array` diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 7b24d9ed92a4..7c690bbf9fe2 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **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 9e1be6a823e8..6ad17a23e384 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.57.1", + "version": "5.58.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.57.1" + "@typescript-eslint/utils": "5.58.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 4e1c52a5b05a..81dc38e8a122 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + + +### Bug Fixes + +* update getLib for new TypeScript targets ES2021, ES2022 ([#6782](https://github.com/typescript-eslint/typescript-eslint/issues/6782)) ([1c04664](https://github.com/typescript-eslint/typescript-eslint/commit/1c0466414300f338c6c4111f8d1eac0c3e6a8983)) + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index 9024906d50e1..344b9c481c4a 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.57.1", + "version": "5.58.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -45,9 +45,9 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.58.0", + "@typescript-eslint/types": "5.58.0", + "@typescript-eslint/typescript-estree": "5.58.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index f151cbdc143e..f1b6766fc71a 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -54,10 +54,14 @@ function getLib(compilerOptions: CompilerOptions): Lib[] { } const target = compilerOptions.target ?? ScriptTarget.ES5; - // https://github.com/Microsoft/TypeScript/blob/59ad375234dc2efe38d8ee0ba58414474c1d5169/src/compiler/utilitiesPublic.ts#L13-L32 + // https://github.com/microsoft/TypeScript/blob/ae582a22ee1bb052e19b7c1bc4cac60509b574e0/src/compiler/utilitiesPublic.ts#L13-L36 switch (target) { case ScriptTarget.ESNext: return ['esnext.full']; + case ScriptTarget.ES2022: + return ['es2022.full']; + case ScriptTarget.ES2021: + return ['es2021.full']; case ScriptTarget.ES2020: return ['es2020.full']; case ScriptTarget.ES2019: diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 35701d256959..47491327d120 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package @typescript-eslint/scope-manager diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 817ea6d6b066..986174f4a978 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.57.1", + "version": "5.58.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -38,12 +38,12 @@ "typecheck": "nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1" + "@typescript-eslint/types": "5.58.0", + "@typescript-eslint/visitor-keys": "5.58.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/typescript-estree": "5.58.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 79ec2d253e88..49a72d6e5656 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + + +### Features + +* **eslint-plugin:** [no-unsafe-enum-comparison] add rule ([#6107](https://github.com/typescript-eslint/typescript-eslint/issues/6107)) ([915f9c2](https://github.com/typescript-eslint/typescript-eslint/commit/915f9c2dc8934eef491a672786ec9f016f3658ba)) + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package @typescript-eslint/type-utils diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 7873c5737414..c06a86cbb6e2 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "5.57.1", + "version": "5.58.0", "description": "Type utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -39,13 +39,13 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/typescript-estree": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/typescript-estree": "5.58.0", + "@typescript-eslint/utils": "5.58.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.57.1", + "@typescript-eslint/parser": "5.58.0", "typescript": "*" }, "peerDependencies": { diff --git a/packages/type-utils/src/typeFlagUtils.ts b/packages/type-utils/src/typeFlagUtils.ts index aa71d702b19a..24d6c5be28b4 100644 --- a/packages/type-utils/src/typeFlagUtils.ts +++ b/packages/type-utils/src/typeFlagUtils.ts @@ -1,8 +1,10 @@ import { unionTypeParts } from 'tsutils'; import * as ts from 'typescript'; +const ANY_OR_UNKNOWN = ts.TypeFlags.Any | ts.TypeFlags.Unknown; + /** - * Gets all of the type flags in a type, iterating through unions automatically + * Gets all of the type flags in a type, iterating through unions automatically. */ export function getTypeFlags(type: ts.Type): ts.TypeFlags { // @ts-expect-error Since typescript 5.0, this is invalid, but uses 0 as the default value of TypeFlags. @@ -14,8 +16,13 @@ export function getTypeFlags(type: ts.Type): ts.TypeFlags { } /** - * Checks if the given type is (or accepts) the given flags - * @param isReceiver true if the type is a receiving type (i.e. the type of a called function's parameter) + * @param flagsToCheck The composition of one or more `ts.TypeFlags`. + * @param isReceiver Whether the type is a receiving type (e.g. the type of a + * called function's parameter). + * @remarks + * Note that if the type is a union, this function will decompose it into the + * parts and get the flags of every union constituent. If this is not desired, + * use the `isTypeFlag` function from tsutils. */ export function isTypeFlagSet( type: ts.Type, @@ -24,7 +31,7 @@ export function isTypeFlagSet( ): boolean { const flags = getTypeFlags(type); - if (isReceiver && flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + if (isReceiver && flags & ANY_OR_UNKNOWN) { return true; } diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 5b97baef4a32..b640b25e12db 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 25840cb896a9..ca10f0f50512 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.57.1", + "version": "5.58.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 e86d1aec5b21..b4ee6d77a6ad 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 85b72e56b2a4..94c8f803682b 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.57.1", + "version": "5.58.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -42,8 +42,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1", + "@typescript-eslint/types": "5.58.0", + "@typescript-eslint/visitor-keys": "5.58.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index e6388e31ea30..946b4e171dc5 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/utils + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package @typescript-eslint/utils diff --git a/packages/utils/package.json b/packages/utils/package.json index 470b1812daa2..9c95ef05ce19 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "5.57.1", + "version": "5.58.0", "description": "Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -42,9 +42,9 @@ "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.58.0", + "@typescript-eslint/types": "5.58.0", + "@typescript-eslint/typescript-estree": "5.58.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -52,7 +52,7 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.57.1", + "@typescript-eslint/parser": "5.58.0", "typescript": "*" }, "funding": { diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index f0f74366d04d..80357445a763 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **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 1734cb0be868..16766751c322 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.57.1", + "version": "5.58.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -39,7 +39,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/types": "5.58.0", "eslint-visitor-keys": "^3.3.0" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index cfea578cef8a..1bc34cb6dc65 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package @typescript-eslint/website-eslint + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **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 28c14117cf9b..8400d43f7ec6 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.57.1", + "version": "5.58.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,8 +16,8 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/utils": "5.57.1" + "@typescript-eslint/types": "5.58.0", + "@typescript-eslint/utils": "5.58.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^23.0.0", @@ -25,11 +25,11 @@ "@rollup/plugin-node-resolve": "^15.0.0", "@rollup/plugin-terser": "^0.4.0", "@rollup/pluginutils": "^5.0.0", - "@typescript-eslint/eslint-plugin": "5.57.1", - "@typescript-eslint/parser": "5.57.1", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1", + "@typescript-eslint/eslint-plugin": "5.58.0", + "@typescript-eslint/parser": "5.58.0", + "@typescript-eslint/scope-manager": "5.58.0", + "@typescript-eslint/typescript-estree": "5.58.0", + "@typescript-eslint/visitor-keys": "5.58.0", "eslint": "*", "esquery": "*", "rollup": "^2.75.4", diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index 39724197726d..49c91353496a 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.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10) + +**Note:** Version bump only for package website + + + + + ## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03) **Note:** Version bump only for package website diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index 0790c7cc72f3..e3b82a0ee98a 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -10,28 +10,28 @@ "id": "Nx (by Nrwl)", "image": "https://images.opencollective.com/nx/0efbe42/logo.png", "name": "Nx (by Nrwl)", - "totalDonations": 650000, + "totalDonations": 675000, "website": "https://nx.dev" }, { "id": "ESLint", "image": "https://images.opencollective.com/eslint/96b09dc/logo.png", "name": "ESLint", - "totalDonations": 275000, + "totalDonations": 290000, "website": "https://eslint.org/" }, { "id": "Hugging Face", "image": "https://images.opencollective.com/huggingface/5c934ee/logo.png", "name": "Hugging Face", - "totalDonations": 220000, + "totalDonations": 240000, "website": "https://huggingface.co" }, { "id": "Airbnb", "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", "name": "Airbnb", - "totalDonations": 160800, + "totalDonations": 165800, "website": "https://www.airbnb.com/" }, { @@ -45,7 +45,7 @@ "id": "Codecademy", "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", "name": "Codecademy", - "totalDonations": 140000, + "totalDonations": 150000, "website": "https://codecademy.com" }, { @@ -73,7 +73,7 @@ "id": "Sourcegraph", "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", "name": "Sourcegraph", - "totalDonations": 90000, + "totalDonations": 100000, "website": "https://about.sourcegraph.com" }, { @@ -97,6 +97,13 @@ "totalDonations": 54000, "website": "https://www.future-processing.com/" }, + { + "id": "DeepSource", + "image": "https://images.opencollective.com/deepsource/0f18cea/logo.png", + "name": "DeepSource", + "totalDonations": 50000, + "website": "https://deepsource.io/" + }, { "id": "Whitebox", "image": "https://images.opencollective.com/whiteboxinc/ef0d11d/logo.png", @@ -104,18 +111,11 @@ "totalDonations": 40000, "website": "https://whitebox.com" }, - { - "id": "DeepSource", - "image": "https://images.opencollective.com/deepsource/0f18cea/logo.png", - "name": "DeepSource", - "totalDonations": 40000, - "website": "https://deepsource.io/" - }, { "id": "STORIS", "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", "name": "STORIS", - "totalDonations": 33000, + "totalDonations": 34500, "website": "https://www.storis.com/" }, { @@ -157,7 +157,7 @@ "id": "David Johnston", "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", "name": "David Johnston", - "totalDonations": 17000, + "totalDonations": 17500, "website": "https://blacksheepcode.com" }, { @@ -185,16 +185,23 @@ "id": "Evil Martians", "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", "name": "Evil Martians", - "totalDonations": 12000, + "totalDonations": 12500, "website": "https://evilmartians.com/" }, { "id": "Balsa", "image": "https://images.opencollective.com/balsa/77de498/logo.png", "name": "Balsa", - "totalDonations": 12000, + "totalDonations": 12500, "website": "https://balsa.com" }, + { + "id": "Corellium", + "image": "https://images.opencollective.com/corellium/aa8c228/logo.png", + "name": "Corellium", + "totalDonations": 10200, + "website": "https://www.corellium.com" + }, { "id": "Gianfranco Palumbo", "image": "https://images.opencollective.com/gianpaj/5d62d25/avatar.png", @@ -209,6 +216,13 @@ "totalDonations": 10000, "website": "https://www.theguardian.com/" }, + { + "id": "THE PADDING", + "image": "https://images.opencollective.com/thepadding/55e79ad/logo.png", + "name": "THE PADDING", + "totalDonations": 10000, + "website": "https://paddn.com/%e9%a6%99%e6%b8%af%e7%b6%b2%e9%a0%81%e8%a8%ad%e8%a8%88%e5%85%ac%e5%8f%b8/" + }, { "id": "Laserhub", "image": "https://images.opencollective.com/laserhub/bae6275/logo.png", diff --git a/packages/website/package.json b/packages/website/package.json index 3457096f16bc..9ea773e1a3de 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "5.57.1", + "version": "5.58.0", "private": true, "scripts": { "build": "docusaurus build", @@ -21,8 +21,8 @@ "@docusaurus/remark-plugin-npm2yarn": "~2.4.0", "@docusaurus/theme-common": "~2.4.0", "@mdx-js/react": "1.6.22", - "@typescript-eslint/parser": "5.57.1", - "@typescript-eslint/website-eslint": "5.57.1", + "@typescript-eslint/parser": "5.58.0", + "@typescript-eslint/website-eslint": "5.58.0", "clsx": "^1.1.1", "eslint": "*", "json-schema": "^0.4.0", @@ -49,13 +49,13 @@ "@types/react": "^18.0.9", "@types/react-helmet": "^6.1.5", "@types/react-router-dom": "^5.3.3", - "@typescript-eslint/eslint-plugin": "5.57.1", + "@typescript-eslint/eslint-plugin": "5.58.0", "copy-webpack-plugin": "^11.0.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.29.4", "eslint-plugin-react-hooks": "^4.5.0", "globby": "^11.1.0", - "monaco-editor": "^0.36.0", + "monaco-editor": "^0.37.0", "webpack": "^5.74.0" }, "browserslist": { diff --git a/packages/website/tests/playground.spec.ts b/packages/website/tests/playground.spec.ts index ad600738b511..340aa2b1e4bb 100644 --- a/packages/website/tests/playground.spec.ts +++ b/packages/website/tests/playground.spec.ts @@ -47,6 +47,24 @@ test.describe('Playground', () => { await expect(page.getByText('let value: string[];')).toBeVisible(); await expect(page.getByText('All is ok!')).toBeVisible(); }); + + test('AST Viewer', async ({ page }) => { + // 1. Type some valid code in the playground + await writeInEditor(page, 'let value: Array;'); + + // 2. Enable AST viewer + await page + .getByRole('combobox', { name: 'AST Viewer' }) + .selectOption({ label: 'ESTree' }); + + // 3. Type some valid code in the playground + await writeInEditor(page, 'let value: Array;'); + + // 4. Validate variable declaration block exists in AST viewer + await expect( + page.getByRole('link', { name: 'VariableDeclaration' }), + ).toBeVisible(); + }); }); async function writeInEditor(page: Page, text: string): Promise { diff --git a/yarn.lock b/yarn.lock index 26ba2a562e22..947c4ecf2426 100644 --- a/yarn.lock +++ b/yarn.lock @@ -154,33 +154,33 @@ dependencies: axe-core "^4.6.3" -"@babel/code-frame@*", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.8.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@*", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4", "@babel/code-frame@^7.8.3": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" + integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.3", "@babel/compat-data@^7.20.5": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298" - integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.3", "@babel/compat-data@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.4.tgz#457ffe647c480dff59c2be092fc3acf71195c87f" + integrity sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g== "@babel/core@*", "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.18.6", "@babel/core@^7.20.2": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.3.tgz#cf1c877284a469da5d1ce1d1e53665253fae712e" - integrity sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw== + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" + integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.3" - "@babel/helper-compilation-targets" "^7.20.7" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" + "@babel/helper-compilation-targets" "^7.21.4" "@babel/helper-module-transforms" "^7.21.2" "@babel/helpers" "^7.21.0" - "@babel/parser" "^7.21.3" + "@babel/parser" "^7.21.4" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.3" - "@babel/types" "^7.21.3" + "@babel/traverse" "^7.21.4" + "@babel/types" "^7.21.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -218,12 +218,12 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.12.5", "@babel/generator@^7.18.7", "@babel/generator@^7.21.3", "@babel/generator@^7.7.2": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.3.tgz#232359d0874b392df04045d72ce2fd9bb5045fce" - integrity sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA== +"@babel/generator@^7.12.5", "@babel/generator@^7.18.7", "@babel/generator@^7.21.4", "@babel/generator@^7.7.2": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" + integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== dependencies: - "@babel/types" "^7.21.3" + "@babel/types" "^7.21.4" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -243,13 +243,13 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3", "@babel/helper-compilation-targets@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" - integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3", "@babel/helper-compilation-targets@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.4.tgz#770cd1ce0889097ceacb99418ee6934ef0572656" + integrity sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg== dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-validator-option" "^7.18.6" + "@babel/compat-data" "^7.21.4" + "@babel/helper-validator-option" "^7.21.0" browserslist "^4.21.3" lru-cache "^5.1.1" semver "^6.3.0" @@ -322,11 +322,11 @@ "@babel/types" "^7.18.9" "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz#ac88b2f76093637489e718a90cec6cf8a9b029af" + integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.21.4" "@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.0", "@babel/helper-module-transforms@^7.21.2": version "7.21.2" @@ -411,7 +411,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== -"@babel/helper-validator-option@^7.18.6": +"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== @@ -444,10 +444,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.8", "@babel/parser@^7.20.7", "@babel/parser@^7.21.2", "@babel/parser@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.3.tgz#1d285d67a19162ff9daa358d4cb41d50c06220b3" - integrity sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ== +"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.8", "@babel/parser@^7.20.7", "@babel/parser@^7.21.2", "@babel/parser@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" + integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" @@ -1194,26 +1194,26 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.12.9", "@babel/traverse@^7.18.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.3", "@babel/traverse@^7.7.2": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.3.tgz#4747c5e7903d224be71f90788b06798331896f67" - integrity sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ== +"@babel/traverse@^7.12.9", "@babel/traverse@^7.18.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.4", "@babel/traverse@^7.7.2": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" + integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.3" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.21.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.3" - "@babel/types" "^7.21.3" + "@babel/parser" "^7.21.4" + "@babel/types" "^7.21.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.3", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.21.3", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.3.tgz#4865a5357ce40f64e3400b0f3b737dc6d4f64d05" - integrity sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg== +"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.3", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.21.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" + integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -3175,12 +3175,12 @@ esquery "^1.0.1" "@playwright/test@^1.27.1": - version "1.32.1" - resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.32.1.tgz#749c9791adb048c266277a39ba0f7e33fe593ffe" - integrity sha512-FTwjCuhlm1qHUGf4hWjfr64UMJD/z0hXYbk+O387Ioe6WdyZQ+0TBDAc6P+pHjx2xCv1VYNgrKbYrNixFWy4Dg== + version "1.32.2" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.32.2.tgz#3cbd76b3f94d0f7f50bf054dbd02e504e85e3865" + integrity sha512-nhaTSDpEdTTttdkDE8Z6K3icuG1DVRxrl98Qq0Lfc63SS9a2sjc9+x8ezysh7MzCKz6Y+nArml3/mmt+gqRmQQ== dependencies: "@types/node" "*" - playwright-core "1.32.1" + playwright-core "1.32.2" optionalDependencies: fsevents "2.3.2" @@ -3475,51 +3475,51 @@ "@svgr/plugin-jsx" "^6.2.1" "@svgr/plugin-svgo" "^6.2.0" -"@swc/core-android-arm-eabi@npm:dummypkg-a@1.0.0", "@swc/core-android-arm64@npm:dummypkg-a@1.0.0", "@swc/core-freebsd-x64@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm-gnueabihf@1.3.44", "@swc/core-linux-arm-gnueabihf@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm64-gnu@1.3.44", "@swc/core-linux-arm64-gnu@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm64-musl@1.3.44", "@swc/core-linux-arm64-musl@npm:dummypkg-a@1.0.0", "@swc/core-win32-arm64-msvc@1.3.44", "@swc/core-win32-arm64-msvc@npm:dummypkg-a@1.0.0", "@swc/core-win32-ia32-msvc@1.3.44", "@swc/core-win32-ia32-msvc@npm:dummypkg-a@1.0.0": +"@swc/core-android-arm-eabi@npm:dummypkg-a@1.0.0", "@swc/core-android-arm64@npm:dummypkg-a@1.0.0", "@swc/core-freebsd-x64@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm-gnueabihf@1.3.46", "@swc/core-linux-arm-gnueabihf@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm64-gnu@1.3.46", "@swc/core-linux-arm64-gnu@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm64-musl@1.3.46", "@swc/core-linux-arm64-musl@npm:dummypkg-a@1.0.0", "@swc/core-win32-arm64-msvc@1.3.46", "@swc/core-win32-arm64-msvc@npm:dummypkg-a@1.0.0", "@swc/core-win32-ia32-msvc@1.3.46", "@swc/core-win32-ia32-msvc@npm:dummypkg-a@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/dummypkg-a/-/dummypkg-a-1.0.0.tgz#02868251461af84d70603446ef5908b72c5c8435" integrity sha512-V9qLfUzVlmSW/ayzlchss1XjAqWXqHmJtzGwnfg/jsnloIUyLKR5a0Djfdgj/Jv3yoNAljIUaelTVjptxtTyGA== -"@swc/core-darwin-arm64@1.3.44": - version "1.3.44" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.44.tgz#e0f5eb9d962c4e6192531c2e3b8c11f55faf1b89" - integrity sha512-Y+oVsCjXUPvr3D9YLuB1gjP84TseM/CRkbPNrf+3JXQhsPEkgxdIdFP1cl/obeqMQrRgPpvSfK+TOvGuOuV22g== +"@swc/core-darwin-arm64@1.3.46": + version "1.3.46" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.46.tgz#810a60fc330190e38c2da39ecae304ba3e44c2d6" + integrity sha512-kY4ASe7SsntDw2B1T70H9K1CFmK8POi+LyIpeCyC96EB9wbH2Sax+ploBB/wZALbYzr/dMJzOCU8QXzdmVS4Rg== -"@swc/core-darwin-x64@1.3.44": - version "1.3.44" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.44.tgz#a8de4c176a9b12f201fc754a56331113a53ec69c" - integrity sha512-bM0IKBjlSD0yHJbd7bE3il5fTu3oUjUO2zjLkzfIx6tiqbmDyvOX8adaSqse9N+d8Ip9p26b5Vo7pMHq0POGkg== +"@swc/core-darwin-x64@1.3.46": + version "1.3.46" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.46.tgz#d419c195191fbe230db5c34c08a5433901258dc9" + integrity sha512-kE3PMk8xW+2BZ3oZiTxxsUU/GzrGwM+qS4frOBz9TYHZe+W1dTtj4F9vBit4PFJ+tv4O6DPt9neGobzdq0UmRw== -"@swc/core-linux-x64-gnu@1.3.44": - version "1.3.44" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.44.tgz#0b8b2544c312f247aa5c5f31671a175ad6488309" - integrity sha512-xV4pDxJM06g0yUDTA22ZHgonzGqf/poIlgADRmEkx9cWWm5qLRhmWrrkVX1xZVvdlcXj1ERnia/UkvrDux96lg== +"@swc/core-linux-x64-gnu@1.3.46": + version "1.3.46" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.46.tgz#13a0407eac724a862165cfaf5f872f2cf5b0359c" + integrity sha512-amqMhTA2CXB6t11hVAZSSPKq4DZ9/sWbW3wYYQHxzqrMJML0726OJs4pt0XnlU7FzdP/9M9j2B/gWCRaCMxXVA== -"@swc/core-linux-x64-musl@1.3.44": - version "1.3.44" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.44.tgz#5b1f76fc1dc75875df59d8c0ff37e99e030f9552" - integrity sha512-NJnnlE8vCkKHoo/wIaoywNN/01vNsvhKUjBgUx865sUM/XWAIanpbV41yfdEkC+Iwd+/zB3ZZnOYql3b+Nn8aQ== +"@swc/core-linux-x64-musl@1.3.46": + version "1.3.46" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.46.tgz#4ce5b648ce14d11dcae4b1dfcbe60854c992343c" + integrity sha512-WOQZTIkJ9khIj5Z2unf6OTrWV9k8br+HZ93RvnamEmJBlLPUuT9IjB+agNhjaDgOpz9/ZldSGqV7vzl5FGQl1Q== -"@swc/core-win32-x64-msvc@1.3.44": - version "1.3.44" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.44.tgz#b137abefbeb3b73a47cc398bc5603ea6bf6a3a7b" - integrity sha512-D9fBRhr44cK4YIKFikpktyUDLkZgVj0ISaSl8IjiTvjqTrE/9+E+dzTNHULn5tc3lHVLLxyVwMjJRr2G0D4O6w== +"@swc/core-win32-x64-msvc@1.3.46": + version "1.3.46" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.46.tgz#46fae36cc69b68ee26a41704e1b6a862ea0a8927" + integrity sha512-rrSAfq+DvpJioBxUsnuH+sKl0eXid1DwkwNzkVGHEreN9GoP7GospWtFq7VDcO6DrS/s3HtR4/TzoIYFEBCRIg== "@swc/core@^1.3.1": - version "1.3.44" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.44.tgz#2886bdd647942f9670b65c02b6d5484ff3070ddd" - integrity sha512-RC25C8nxOCdfGS//F9Q8aHKx4XoCsxvgO+sSUhvt7zDz1Y2ruVUTu2UOH0VeE0WkA8j6oEZH+xH2SUfDUkxXdA== + version "1.3.46" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.46.tgz#7c49230113dfcce79b778d4d70e23e93e667350a" + integrity sha512-WxzgJMWUBVJ95HsvEqlWzM3Qxp2FQrPa4QdAkQQuuvCMnfdctGUbhX/c3LiSRlWrl2LIkYAi4bLansTOol4QcQ== optionalDependencies: - "@swc/core-darwin-arm64" "1.3.44" - "@swc/core-darwin-x64" "1.3.44" - "@swc/core-linux-arm-gnueabihf" "1.3.44" - "@swc/core-linux-arm64-gnu" "1.3.44" - "@swc/core-linux-arm64-musl" "1.3.44" - "@swc/core-linux-x64-gnu" "1.3.44" - "@swc/core-linux-x64-musl" "1.3.44" - "@swc/core-win32-arm64-msvc" "1.3.44" - "@swc/core-win32-ia32-msvc" "1.3.44" - "@swc/core-win32-x64-msvc" "1.3.44" + "@swc/core-darwin-arm64" "1.3.46" + "@swc/core-darwin-x64" "1.3.46" + "@swc/core-linux-arm-gnueabihf" "1.3.46" + "@swc/core-linux-arm64-gnu" "1.3.46" + "@swc/core-linux-arm64-musl" "1.3.46" + "@swc/core-linux-x64-gnu" "1.3.46" + "@swc/core-linux-x64-musl" "1.3.46" + "@swc/core-win32-arm64-msvc" "1.3.46" + "@swc/core-win32-ia32-msvc" "1.3.46" + "@swc/core-win32-x64-msvc" "1.3.46" "@swc/jest@^0.2.21": version "0.2.24" @@ -3939,9 +3939,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^18.0.9": - version "18.0.31" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.31.tgz#a69ef8dd7bfa849734d258c793a8fe343a338205" - integrity sha512-EEG67of7DsvRDU6BLLI0p+k1GojDLz9+lZsnCpCRTa/lOokvyPBvp8S5x+A24hME3yyQuIipcP70KJ6H7Qupww== + version "18.0.33" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.33.tgz#a1575160cb4376787c2f5fe0312302f824baa61e" + integrity sha512-sHxzVxeanvQyQ1lr8NSHaj0kDzcNiGpILEVt69g9S31/7PfMvNCKLKcsHw4lYKjs3cGNJjXSP4mYzX43QlnjNA== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -6499,9 +6499,9 @@ ejs@^3.1.6, ejs@^3.1.7: jake "^10.8.5" electron-to-chromium@^1.4.284: - version "1.4.345" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.345.tgz#c90b7183b39245cddf0e990337469063bfced6f0" - integrity sha512-znGhOQK2TUYLICgS25uaM0a7pHy66rSxbre7l762vg9AUoCcJK+Bu+HCPWpjL/U/kK8/Hf+6E0szAUJSyVYb3Q== + version "1.4.348" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.348.tgz#f49379dc212d79f39112dd026f53e371279e433d" + integrity sha512-gM7TdwuG3amns/1rlgxMbeeyNoBFPa+4Uu0c7FeROWh4qWmvSOnvcslKmWy51ggLKZ2n/F/4i2HJ+PVNxH9uCQ== emittery@^0.13.1: version "0.13.1" @@ -6800,11 +6800,11 @@ eslint-module-utils@^2.7.4: debug "^3.2.7" eslint-plugin-deprecation@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.3.3.tgz#065b5d36ff220afe139f2b19af57454a13464731" - integrity sha512-Bbkv6ZN2cCthVXz/oZKPwsSY5S/CbgTLRG4Q2s2gpPpgNsT0uJ0dB5oLNiWzFYY8AgKX4ULxXFG1l/rDav9QFA== + version "1.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.4.1.tgz#09a2889210955fd1a5c37703922c01724aba80eb" + integrity sha512-4vxTghWzxsBukPJVQupi6xlTuDc8Pyi1QlRCrFiLgwLPMJQW3cJCNaehJUKQqQFvuue5m4W27e179Y3Qjzeghg== dependencies: - "@typescript-eslint/experimental-utils" "^5.0.0" + "@typescript-eslint/utils" "^5.57.0" tslib "^2.3.1" tsutils "^3.21.0" @@ -7810,12 +7810,12 @@ glob-to-regexp@^0.4.1: integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob@*, glob@^9.2.0, glob@^9.3.0, glob@^9.3.1: - version "9.3.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.2.tgz#8528522e003819e63d11c979b30896e0eaf52eda" - integrity sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA== + version "9.3.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.4.tgz#e75dee24891a80c25cc7ee1dd327e126b98679af" + integrity sha512-qaSc49hojMOv1EPM4EuyITjDSgSKI0rthoHnvE81tcOi1SCVndHko7auqxdQ14eiQG2NDBJBE86+2xIrbIvrbA== dependencies: fs.realpath "^1.0.0" - minimatch "^7.4.1" + minimatch "^8.0.2" minipass "^4.2.4" path-scurry "^1.6.1" @@ -10434,13 +10434,20 @@ minimatch@^6.1.6: dependencies: brace-expansion "^2.0.1" -minimatch@^7.4.1, minimatch@^7.4.2: +minimatch@^7.4.2: version "7.4.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.3.tgz#012cbf110a65134bb354ae9773b55256cdb045a2" integrity sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A== dependencies: brace-expansion "^2.0.1" +minimatch@^8.0.2: + version "8.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.3.tgz#0415cb9bb0c1d8ac758c8a673eb1d288e13f5e75" + integrity sha512-tEEvU9TkZgnFDCtpnrEYnPsjT7iUx42aXfs4bzmQ5sMA09/6hZY0jeZcGkXyDagiBOvkUjNo8Viom+Me6+2x7g== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -10559,10 +10566,10 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -monaco-editor@^0.36.0: - version "0.36.1" - resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.36.1.tgz#aad528c815605307473a1634612946921d8079b5" - integrity sha512-/CaclMHKQ3A6rnzBzOADfwdSJ25BFoFT0Emxsc4zYVyav5SkK9iA6lEtIeuN/oRYbwPgviJT+t3l+sjFa28jYg== +monaco-editor@^0.37.0: + version "0.37.1" + resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.37.1.tgz#d6f5ffb593e019e74e19bf8a2bdef5a691876f4e" + integrity sha512-jLXEEYSbqMkT/FuJLBZAVWGuhIb4JNwHE9kPTorAVmsdZ4UzHAfgWxLsVtD7pLRFaOwYPhNG9nUCpmFL1t/dIg== ms@2.0.0: version "2.0.0" @@ -11638,10 +11645,10 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -playwright-core@1.32.1: - version "1.32.1" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.32.1.tgz#5a10c32403323b07d75ea428ebeed866a80b76a1" - integrity sha512-KZYUQC10mXD2Am1rGlidaalNGYk3LU1vZqqNk0gT4XPty1jOqgup8KDP8l2CUlqoNKhXM5IfGjWgW37xvGllBA== +playwright-core@1.32.2: + version "1.32.2" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.32.2.tgz#608810c3c4486fb86a224732ac0d3560a96ded8b" + integrity sha512-zD7aonO+07kOTthsrCR3YCVnDcqSHIJpdFUtZEMOb6//1Rc7/6mZDRdw+nlzcQiQltOOsiqI3rrSyn/SlyjnJQ== pluralize@^8.0.0: version "8.0.0" @@ -14154,9 +14161,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@*, "typescript@>=3.3.1 <5.1.0", "typescript@^3 || ^4", typescript@next, typescript@~4.8.4, typescript@~5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5" - integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw== + version "5.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf" + integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA== ua-parser-js@^0.7.30: version "0.7.31" @@ -14692,9 +14699,9 @@ webpack-sources@^3.2.2, webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.73.0, webpack@^5.74.0: - version "5.76.3" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.76.3.tgz#dffdc72c8950e5b032fddad9c4452e7787d2f489" - integrity sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA== + version "5.78.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.78.0.tgz#836452a12416af2a7beae906b31644cb2562f9e6" + integrity sha512-gT5DP72KInmE/3azEaQrISjTvLYlSM0j1Ezhht/KLVkrqtv10JoP/RXhwmX/frrutOPuSq3o5Vq0ehR/4Vmd1g== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51"