diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index e57c4b5eb3ea..000000000000 --- a/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -yarn pre-push diff --git a/.markdownlint.json b/.markdownlint.json index ba2c8eb2df50..55f1ef99429f 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -69,7 +69,8 @@ "details", "summary", "Tabs", - "TabItem" + "TabItem", + "RulesTable" ] }, // MD034/no-bare-urls - Bare URL used diff --git a/CHANGELOG.md b/CHANGELOG.md index a30dbca9a801..d3e897d2bd19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + + +### Features + +* **eslint-plugin:** [no-shadow] add shadowed variable location to the error message ([#5183](https://github.com/typescript-eslint/typescript-eslint/issues/5183)) ([8ca08e9](https://github.com/typescript-eslint/typescript-eslint/commit/8ca08e9f18d59b29715c667fbb7d237f6e9a96ba)) +* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) diff --git a/lerna.json b/lerna.json index df0f01f98725..cf6d5002901b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.29.0", + "version": "5.30.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/package.json b/package.json index 4155bb39cb7f..59e27548d8e3 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "lint": "cross-env NODE_OPTIONS=\"--max-old-space-size=16384\" eslint .", "postinstall": "yarn husky install && yarn build", "pre-commit": "yarn lint-staged", - "pre-push": "yarn check-format", "start": "nx run website:start", "test": "nx run-many --target=test --all --parallel", "test-integration": "yarn jest -c ./tests/integration/jest.config.js", @@ -91,7 +90,7 @@ "jest-diff": "^28.1.0", "jest-snapshot": "^28.1.0", "jest-specific-snapshot": "^5.0.0", - "lerna": "5.1.2", + "lerna": "5.1.4", "lint-staged": "^13.0.0", "make-dir": "^3.1.0", "markdownlint-cli": "^0.31.1", diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index daaae162f172..7a23e114979c 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + + +### Features + +* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 20d24f5cc6c2..74353e0b5baa 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.29.0", + "version": "5.30.0", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/ast-spec/src/unions/EntityName.ts b/packages/ast-spec/src/unions/EntityName.ts index 82f7b1c9b0ca..8a7364bef6b9 100644 --- a/packages/ast-spec/src/unions/EntityName.ts +++ b/packages/ast-spec/src/unions/EntityName.ts @@ -1,4 +1,5 @@ import type { Identifier } from '../expression/Identifier/spec'; +import type { ThisExpression } from '../expression/ThisExpression/spec'; import type { TSQualifiedName } from '../type/TSQualifiedName/spec'; -export type EntityName = Identifier | TSQualifiedName; +export type EntityName = Identifier | ThisExpression | TSQualifiedName; diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index c524f25a676b..773d918f5188 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 7079d11f6c8a..873c70308e51 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.29.0", + "version": "5.30.0", "private": true, "main": "dist/index.js", "scripts": { @@ -14,8 +14,8 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/utils": "5.29.0", + "@typescript-eslint/scope-manager": "5.30.0", + "@typescript-eslint/utils": "5.30.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 1a51e36cbd3d..d9855c07d360 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 11f41404546c..e21b1761ae3e 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.29.0", + "version": "5.30.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/utils": "5.29.0", + "@typescript-eslint/utils": "5.30.0", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.29.0" + "@typescript-eslint/parser": "5.30.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 1654a0077c83..e91185d91a18 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + + +### Features + +* **eslint-plugin:** [no-shadow] add shadowed variable location to the error message ([#5183](https://github.com/typescript-eslint/typescript-eslint/issues/5183)) ([8ca08e9](https://github.com/typescript-eslint/typescript-eslint/commit/8ca08e9f18d59b29715c667fbb7d237f6e9a96ba)) +* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 60a769945183..5124ce841ae0 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -89,152 +89,7 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int ## Supported Rules - - -**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | -| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Require using either `T[]` or `Array` for arrays | :lock: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallow awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./docs/rules/ban-ts-comment.md) | Disallow `@ts-` comments or require descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./docs/rules/ban-tslint-comment.md) | Disallow `// tslint:` comments | :lock: | :wrench: | | -| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Disallow certain types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./docs/rules/class-literal-property-style.md) | Enforce that literals on classes are exposed in a consistent style | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-generic-constructors`](./docs/rules/consistent-generic-constructors.md) | Enforce specifying generic type arguments on type annotation or constructor name of a constructor call | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./docs/rules/consistent-indexed-object-style.md) | Require or disallow the `Record` type | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforce consistent usage of type assertions | :lock: | | | -| [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Enforce type definitions to consistently use either `interface` or `type` | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./docs/rules/consistent-type-exports.md) | Enforce consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./docs/rules/consistent-type-imports.md) | Enforce consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforce using a particular method signature syntax | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforce naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Require `.toString()` to only be called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./docs/rules/no-confusing-void-expression.md) | Require expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-duplicate-enum-values`](./docs/rules/no-duplicate-enum-values.md) | Disallow duplicate enum member values | :lock: | | | -| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow using the `delete` operator on computed key expressions | :lock: | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./docs/rules/no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Disallow classes used as namespaces | :lock: | | | -| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Require Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallow `void` type outside of generic or return types | :lock: | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./docs/rules/no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Disallow Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./docs/rules/no-non-null-asserted-nullish-coalescing.md) | Disallow non-null assertions in the left operand of a nullish coalescing operator | :lock: | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallow non-null assertions after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallow non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-redundant-type-constituents`](./docs/rules/no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | -| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallow invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Disallow unnecessary equality comparisons against boolean literals | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Disallow conditionals where the type is always truthy or always falsy | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Disallow unnecessary namespace qualifiers | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Disallow type arguments that are equal to the default | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Disallow type assertions that do not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./docs/rules/no-unnecessary-type-constraint.md) | Disallow unnecessary constraints on generic types | :white_check_mark: | | | -| [`@typescript-eslint/no-unsafe-argument`](./docs/rules/no-unsafe-argument.md) | Disallow calling a function with a value with type `any` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallow assigning a value with type `any` to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallow calling a value with type `any` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallow member access on a value with type `any` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallow returning a value with type `any` from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-useless-empty-export`](./docs/rules/no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | -| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallow `require` statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./docs/rules/non-nullable-type-assertion-style.md) | Enforce non-null assertions over explicit type casts | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/parameter-properties`](./docs/rules/parameter-properties.md) | Require or disallow parameter properties in class constructors | | | | -| [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Enforce the use of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Require each enum member value to be explicitly initialized | | | | -| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Enforce the use of `for-of` loop over the standard `for` loop where possible | :lock: | | | -| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Enforce using function types instead of interfaces with call signatures | :lock: | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./docs/rules/prefer-literal-enum-member.md) | Require all enum members to be literal values | :lock: | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./docs/rules/prefer-nullish-coalescing.md) | Enforce using the nullish coalescing operator instead of logical chaining | :lock: | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./docs/rules/prefer-optional-chain.md) | Enforce using concise optional chain expressions instead of chained logical ands | :lock: | | | -| [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Require private members to be marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Enforce using type parameter when calling `Array#reduce` instead of casting | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce `RegExp#exec` over `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./docs/rules/prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Enforce using `@ts-expect-error` over `@ts-ignore` | :lock: | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Require any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Require `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | Require both operands of addition to have type `number` or `string` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of `string` type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./docs/rules/sort-type-union-intersection-members.md) | Enforce members of a type union/intersection to be sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Disallow certain types in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./docs/rules/switch-exhaustiveness-check.md) | Require switch-case statements to be exhaustive with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Disallow certain triple slash directives in favor of ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Require type annotations in certain places | | | | -| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforce unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Disallow two overloads that could be unified into one with a union or an optional/rest parameter | :lock: | | | - - - -### Extension Rules - -In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it. -In these cases, we create what we call an extension rule; a rule within our plugin that has the same functionality, but also supports TypeScript. - - - -**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-dangle`](./docs/rules/comma-dangle.md) | Require or disallow trailing commas | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforce consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | Enforce dot notation whenever possible | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | Require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | -| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | -| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-restricted-imports`](./docs/rules/no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | -| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | :lock: | | :thought_balloon: | -| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | :lock: | | | -| [`@typescript-eslint/object-curly-spacing`](./docs/rules/object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | -| [`@typescript-eslint/padding-line-between-statements`](./docs/rules/padding-line-between-statements.md) | Require or disallow padding lines between statements | | :wrench: | | -| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforce consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-blocks`](./docs/rules/space-before-blocks.md) | Enforce consistent spacing before blocks | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforce consistent spacing before function parenthesis | | :wrench: | | -| [`@typescript-eslint/space-infix-ops`](./docs/rules/space-infix-ops.md) | Require spacing around infix operators | | :wrench: | | - - +For the exhaustive list of supported rules, [please see our website](https://typescript-eslint.io/rules/). ## Contributing diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 805f126f8228..7c6bd00d36df 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -11,149 +11,13 @@ See [Configs](/docs/linting/configs) for how to enable recommended rules using c ## Supported Rules - +import RulesTable from "@site/src/components/RulesTable"; -**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./adjacent-overload-signatures.md) | Require that member overloads be consecutive | :white_check_mark: | | | -| [`@typescript-eslint/array-type`](./array-type.md) | Require using either `T[]` or `Array` for arrays | :lock: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./await-thenable.md) | Disallow awaiting a value that is not a Thenable | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-comment`](./ban-ts-comment.md) | Disallow `@ts-` comments or require descriptions after directive | :white_check_mark: | | | -| [`@typescript-eslint/ban-tslint-comment`](./ban-tslint-comment.md) | Disallow `// tslint:` comments | :lock: | :wrench: | | -| [`@typescript-eslint/ban-types`](./ban-types.md) | Disallow certain types | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/class-literal-property-style`](./class-literal-property-style.md) | Enforce that literals on classes are exposed in a consistent style | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-generic-constructors`](./consistent-generic-constructors.md) | Enforce specifying generic type arguments on type annotation or constructor name of a constructor call | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-indexed-object-style`](./consistent-indexed-object-style.md) | Require or disallow the `Record` type | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-type-assertions`](./consistent-type-assertions.md) | Enforce consistent usage of type assertions | :lock: | | | -| [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) | Enforce type definitions to consistently use either `interface` or `type` | :lock: | :wrench: | | -| [`@typescript-eslint/consistent-type-exports`](./consistent-type-exports.md) | Enforce consistent usage of type exports | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/consistent-type-imports`](./consistent-type-imports.md) | Enforce consistent usage of type imports | | :wrench: | | -| [`@typescript-eslint/explicit-function-return-type`](./explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | -| [`@typescript-eslint/explicit-member-accessibility`](./explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | -| [`@typescript-eslint/explicit-module-boundary-types`](./explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | | | | -| [`@typescript-eslint/member-delimiter-style`](./member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | -| [`@typescript-eslint/member-ordering`](./member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/method-signature-style`](./method-signature-style.md) | Enforce using a particular method signature syntax | | :wrench: | | -| [`@typescript-eslint/naming-convention`](./naming-convention.md) | Enforce naming conventions for everything across a codebase | | | :thought_balloon: | -| [`@typescript-eslint/no-base-to-string`](./no-base-to-string.md) | Require `.toString()` to only be called on objects which provide useful information when stringified | :lock: | | :thought_balloon: | -| [`@typescript-eslint/no-confusing-non-null-assertion`](./no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | :lock: | :wrench: | | -| [`@typescript-eslint/no-confusing-void-expression`](./no-confusing-void-expression.md) | Require expressions of type void to appear in statement position | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-duplicate-enum-values`](./no-duplicate-enum-values.md) | Disallow duplicate enum member values | :lock: | | | -| [`@typescript-eslint/no-dynamic-delete`](./no-dynamic-delete.md) | Disallow using the `delete` operator on computed key expressions | :lock: | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./no-empty-interface.md) | Disallow the declaration of empty interfaces | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-explicit-any`](./no-explicit-any.md) | Disallow the `any` type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extra-non-null-assertion`](./no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./no-extraneous-class.md) | Disallow classes used as namespaces | :lock: | | | -| [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) | Require Promise-like statements to be handled appropriately | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./no-inferrable-types.md) | Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-void-type`](./no-invalid-void-type.md) | Disallow `void` type outside of generic or return types | :lock: | | | -| [`@typescript-eslint/no-meaningless-void-operator`](./no-meaningless-void-operator.md) | Disallow the `void` operator except when used to discard a value | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-misused-new`](./no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :white_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./no-misused-promises.md) | Disallow Promises in places not designed to handle them | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-namespace`](./no-namespace.md) | Disallow custom TypeScript modules and namespaces | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-asserted-nullish-coalescing`](./no-non-null-asserted-nullish-coalescing.md) | Disallow non-null assertions in the left operand of a nullish coalescing operator | :lock: | | | -| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./no-non-null-asserted-optional-chain.md) | Disallow non-null assertions after an optional chain expression | :white_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./no-non-null-assertion.md) | Disallow non-null assertions using the `!` postfix operator | :white_check_mark: | | | -| [`@typescript-eslint/no-redundant-type-constituents`](./no-redundant-type-constituents.md) | Disallow members of unions and intersections that do nothing or override type information | | | :thought_balloon: | -| [`@typescript-eslint/no-require-imports`](./no-require-imports.md) | Disallow invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./no-this-alias.md) | Disallow aliasing `this` | :white_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./no-type-alias.md) | Disallow type aliases | | | | -| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./no-unnecessary-boolean-literal-compare.md) | Disallow unnecessary equality comparisons against boolean literals | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-condition`](./no-unnecessary-condition.md) | Disallow conditionals where the type is always truthy or always falsy | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-qualifier`](./no-unnecessary-qualifier.md) | Disallow unnecessary namespace qualifiers | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-arguments`](./no-unnecessary-type-arguments.md) | Disallow type arguments that are equal to the default | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./no-unnecessary-type-assertion.md) | Disallow type assertions that do not change the type of an expression | :white_check_mark: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.md) | Disallow unnecessary constraints on generic types | :white_check_mark: | | | -| [`@typescript-eslint/no-unsafe-argument`](./no-unsafe-argument.md) | Disallow calling a function with a value with type `any` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-assignment`](./no-unsafe-assignment.md) | Disallow assigning a value with type `any` to variables and properties | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-call`](./no-unsafe-call.md) | Disallow calling a value with type `any` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-member-access`](./no-unsafe-member-access.md) | Disallow member access on a value with type `any` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unsafe-return`](./no-unsafe-return.md) | Disallow returning a value with type `any` from a function | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-useless-empty-export`](./no-useless-empty-export.md) | Disallow empty exports that don't change anything in a module file | | :wrench: | | -| [`@typescript-eslint/no-var-requires`](./no-var-requires.md) | Disallow `require` statements except in import statements | :white_check_mark: | | | -| [`@typescript-eslint/non-nullable-type-assertion-style`](./non-nullable-type-assertion-style.md) | Enforce non-null assertions over explicit type casts | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/parameter-properties`](./parameter-properties.md) | Require or disallow parameter properties in class constructors | | | | -| [`@typescript-eslint/prefer-as-const`](./prefer-as-const.md) | Enforce the use of `as const` over literal type | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-enum-initializers`](./prefer-enum-initializers.md) | Require each enum member value to be explicitly initialized | | | | -| [`@typescript-eslint/prefer-for-of`](./prefer-for-of.md) | Enforce the use of `for-of` loop over the standard `for` loop where possible | :lock: | | | -| [`@typescript-eslint/prefer-function-type`](./prefer-function-type.md) | Enforce using function types instead of interfaces with call signatures | :lock: | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./prefer-includes.md) | Enforce `includes` method over `indexOf` method | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-literal-enum-member`](./prefer-literal-enum-member.md) | Require all enum members to be literal values | :lock: | | | -| [`@typescript-eslint/prefer-namespace-keyword`](./prefer-namespace-keyword.md) | Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-nullish-coalescing`](./prefer-nullish-coalescing.md) | Enforce using the nullish coalescing operator instead of logical chaining | :lock: | | :thought_balloon: | -| [`@typescript-eslint/prefer-optional-chain`](./prefer-optional-chain.md) | Enforce using concise optional chain expressions instead of chained logical ands | :lock: | | | -| [`@typescript-eslint/prefer-readonly`](./prefer-readonly.md) | Require private members to be marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-readonly-parameter-types`](./prefer-readonly-parameter-types.md) | Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs | | | :thought_balloon: | -| [`@typescript-eslint/prefer-reduce-type-parameter`](./prefer-reduce-type-parameter.md) | Enforce using type parameter when calling `Array#reduce` instead of casting | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./prefer-regexp-exec.md) | Enforce `RegExp#exec` over `String#match` if no global flag is provided | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-return-this-type`](./prefer-return-this-type.md) | Enforce that `this` is used when only `this` type is returned | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./prefer-string-starts-ends-with.md) | Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-ts-expect-error`](./prefer-ts-expect-error.md) | Enforce using `@ts-expect-error` over `@ts-ignore` | :lock: | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./promise-function-async.md) | Require any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./require-array-sort-compare.md) | Require `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | -| [`@typescript-eslint/restrict-plus-operands`](./restrict-plus-operands.md) | Require both operands of addition to have type `number` or `string` | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/restrict-template-expressions`](./restrict-template-expressions.md) | Enforce template literal expressions to be of `string` type | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/sort-type-union-intersection-members`](./sort-type-union-intersection-members.md) | Enforce members of a type union/intersection to be sorted alphabetically | | :wrench: | | -| [`@typescript-eslint/strict-boolean-expressions`](./strict-boolean-expressions.md) | Disallow certain types in boolean expressions | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/switch-exhaustiveness-check`](./switch-exhaustiveness-check.md) | Require switch-case statements to be exhaustive with union type | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./triple-slash-reference.md) | Disallow certain triple slash directives in favor of ES6-style import declarations | :white_check_mark: | | | -| [`@typescript-eslint/type-annotation-spacing`](./type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | -| [`@typescript-eslint/typedef`](./typedef.md) | Require type annotations in certain places | | | | -| [`@typescript-eslint/unbound-method`](./unbound-method.md) | Enforce unbound methods are called with their expected scope | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./unified-signatures.md) | Disallow two overloads that could be unified into one with a union or an optional/rest parameter | :lock: | | | - - + ## Extension Rules In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it. In these cases, we create what we call an extension rule; a rule within our plugin that has the same functionality, but also supports TypeScript. - - -**Key**: :white_check_mark: = recommended, :lock: = strict, :wrench: = fixable, :thought_balloon: = requires type information - -| Name | Description | :white_check_mark::lock: | :wrench: | :thought_balloon: | -| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-dangle`](./comma-dangle.md) | Require or disallow trailing commas | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./comma-spacing.md) | Enforce consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./dot-notation.md) | Enforce dot notation whenever possible | :lock: | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./init-declarations.md) | Require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-empty-function`](./no-empty-function.md) | Disallow empty functions | :white_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | | -| [`@typescript-eslint/no-implied-eval`](./no-implied-eval.md) | Disallow the use of `eval()`-like methods | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-invalid-this`](./no-invalid-this.md) | Disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loop-func`](./no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | -| [`@typescript-eslint/no-loss-of-precision`](./no-loss-of-precision.md) | Disallow literal numbers that lose precision | :white_check_mark: | | | -| [`@typescript-eslint/no-magic-numbers`](./no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-restricted-imports`](./no-restricted-imports.md) | Disallow specified modules when loaded by `import` | | | | -| [`@typescript-eslint/no-shadow`](./no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-throw-literal`](./no-throw-literal.md) | Disallow throwing literals as exceptions | :lock: | | :thought_balloon: | -| [`@typescript-eslint/no-unused-expressions`](./no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./no-unused-vars.md) | Disallow unused variables | :white_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./no-useless-constructor.md) | Disallow unnecessary constructors | :lock: | | | -| [`@typescript-eslint/object-curly-spacing`](./object-curly-spacing.md) | Enforce consistent spacing inside braces | | :wrench: | | -| [`@typescript-eslint/padding-line-between-statements`](./padding-line-between-statements.md) | Require or disallow padding lines between statements | | :wrench: | | -| [`@typescript-eslint/quotes`](./quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./require-await.md) | Disallow async functions which have no `await` expression | :white_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./return-await.md) | Enforce consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-blocks`](./space-before-blocks.md) | Enforce consistent spacing before blocks | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./space-before-function-paren.md) | Enforce consistent spacing before function parenthesis | | :wrench: | | -| [`@typescript-eslint/space-infix-ops`](./space-infix-ops.md) | Require spacing around infix operators | | :wrench: | | - - + diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 3a01a3d6695a..9abe0fbfb9ff 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.29.0", + "version": "5.30.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,9 +44,9 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/type-utils": "5.29.0", - "@typescript-eslint/utils": "5.29.0", + "@typescript-eslint/scope-manager": "5.30.0", + "@typescript-eslint/type-utils": "5.30.0", + "@typescript-eslint/utils": "5.30.0", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index a80a1b506732..a6b9b7fd735d 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -12,7 +12,7 @@ import { } from '@typescript-eslint/scope-manager'; import * as util from '../util'; -type MessageIds = 'noShadow'; +type MessageIds = 'noShadow' | 'noShadowGlobal'; type Options = [ { allow?: string[]; @@ -64,7 +64,9 @@ export default util.createRule({ }, ], messages: { - noShadow: "'{{name}}' is already declared in the upper scope.", + noShadow: + "'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.", + noShadowGlobal: "'{{name}}' is already a global variable.", }, }, defaultOptions: [ @@ -517,6 +519,28 @@ export default util.createRule({ ); } + /** + * Get declared line and column of a variable. + * @param variable The variable to get. + * @returns The declared line and column of the variable. + */ + function getDeclaredLocation( + variable: TSESLint.Scope.Variable, + ): { global: true } | { global: false; line: number; column: number } { + const identifier = variable.identifiers[0]; + if (identifier) { + return { + global: false, + line: identifier.loc.start.line, + column: identifier.loc.start.column + 1, + }; + } else { + return { + global: true, + }; + } + } + /** * Checks the current context for shadowed variables. * @param {Scope} scope Fixme @@ -595,12 +619,25 @@ export default util.createRule({ ) && !(options.hoist !== 'all' && isInTdz(variable, shadowed)) ) { + const location = getDeclaredLocation(shadowed); + context.report({ node: variable.identifiers[0], - messageId: 'noShadow', - data: { - name: variable.name, - }, + ...(location.global + ? { + messageId: 'noShadowGlobal', + data: { + name: variable.name, + }, + } + : { + messageId: 'noShadow', + data: { + name: variable.name, + shadowedLine: location.line, + shadowedColumn: location.column, + }, + }), }); } } diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index efb5edd4f2bf..13262e4ce73c 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -9,12 +9,6 @@ import { titleCase } from 'title-case'; const docsRoot = path.resolve(__dirname, '../docs/rules'); const rulesData = Object.entries(rules); -function createRuleLink(ruleName: string, readmePath: string): string { - return `[\`@typescript-eslint/${ruleName}\`](${ - readmePath.includes('docs/rules') ? '.' : './docs/rules' - }/${ruleName}.md)`; -} - function parseMarkdownFile(filePath: string): marked.TokensList { const file = fs.readFileSync(filePath, 'utf-8'); @@ -24,27 +18,6 @@ function parseMarkdownFile(filePath: string): marked.TokensList { }); } -function parseReadme(readmePath: string): { - base: marked.Tokens.Table; - extension: marked.Tokens.Table; -} { - const readme = parseMarkdownFile(readmePath); - - // find the table - const rulesTables = readme.filter( - (token): token is marked.Tokens.Table => - 'type' in token && token.type === 'table', - ); - if (rulesTables.length !== 2) { - throw Error('Could not find both rules tables in README.md'); - } - - return { - base: rulesTables[0], - extension: rulesTables[1], - }; -} - function isEmptySchema(schema: JSONSchema4 | JSONSchema4[]): boolean { return Array.isArray(schema) ? schema.length === 0 @@ -207,87 +180,3 @@ describe('Validating rule metadata', () => { }); } }); - -describe.each([ - path.join(__dirname, '../README.md'), - path.join(__dirname, '../docs/rules/README.md'), -])('%s', readmePath => { - const rulesTables = parseReadme(readmePath); - const notDeprecated = rulesData.filter(([, rule]) => !rule.meta.deprecated); - const baseRules = notDeprecated.filter( - ([, rule]) => !rule.meta.docs?.extendsBaseRule, - ); - const extensionRules = notDeprecated.filter( - ([, rule]) => rule.meta.docs?.extendsBaseRule, - ); - - it('All non-deprecated base rules should have a row in the base rules table, and the table should be ordered alphabetically', () => { - const baseRuleNames = baseRules - .map(([ruleName]) => ruleName) - .sort() - .map(ruleName => createRuleLink(ruleName, readmePath)); - - expect(rulesTables.base.rows.map(row => row[0].text)).toStrictEqual( - baseRuleNames, - ); - }); - it('All non-deprecated extension rules should have a row in the base rules table, and the table should be ordered alphabetically', () => { - const extensionRuleNames = extensionRules - .map(([ruleName]) => ruleName) - .sort() - .map(ruleName => createRuleLink(ruleName, readmePath)); - - expect(rulesTables.extension.rows.map(row => row[0].text)).toStrictEqual( - extensionRuleNames, - ); - }); - - for (const [ruleName, rule] of notDeprecated) { - describe(`Checking rule ${ruleName}`, () => { - const ruleRow: string[] | undefined = ( - rule.meta.docs?.extendsBaseRule - ? rulesTables.extension.rows - : rulesTables.base.rows - ) - .find(row => row[0].text.includes(`/${ruleName}.md`)) - ?.map(cell => cell.text); - if (!ruleRow) { - // rule is in the wrong table, the first two tests will catch this, so no point in creating noise; - // these tests will ofc fail in that case - return; - } - - it('Link column should be correct', () => { - expect(ruleRow[0]).toBe(createRuleLink(ruleName, readmePath)); - }); - - it('Description column should be correct', () => { - expect(ruleRow[1]).toBe(rule.meta.docs?.description); - }); - - it('Recommended column should be correct', () => { - expect(ruleRow[2]).toBe( - rule.meta.docs?.recommended === 'strict' - ? ':lock:' - : rule.meta.docs?.recommended - ? ':white_check_mark:' - : '', - ); - }); - - it('Fixable column should be correct', () => { - expect(ruleRow[3]).toBe( - rule.meta.fixable !== undefined ? ':wrench:' : '', - ); - }); - - it('Requiring type information column should be correct', () => { - expect(ruleRow[4]).toBe( - rule.meta.docs?.requiresTypeChecking === true - ? ':thought_balloon:' - : '', - ); - }); - }); - } -}); diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index 9cff63994d39..3335e04e7419 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -248,6 +248,16 @@ class Foo {} ` export type AppState = typeof import('./src/store/reducers').default; `, + ` +let self: typeof this; +let foo: typeof this.foo; +const obj = { + foo: '', + bar() { + let self: typeof this; + }, +}; + `, ], invalid: [ { diff --git a/packages/eslint-plugin/tests/rules/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow.test.ts deleted file mode 100644 index 69a69f2f70eb..000000000000 --- a/packages/eslint-plugin/tests/rules/no-shadow.test.ts +++ /dev/null @@ -1,2026 +0,0 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; -import rule from '../../src/rules/no-shadow'; -import { RuleTester } from '../RuleTester'; - -const ruleTester = new RuleTester({ - parserOptions: { - sourceType: 'module', - }, - parser: '@typescript-eslint/parser', -}); - -ruleTester.run('no-shadow TS tests', rule, { - valid: [ - // nested conditional types - ` -export type ArrayInput = Func extends (arg0: Array) => any - ? T[] - : Func extends (...args: infer T) => any - ? T - : never; - `, - ` -function foo() { - var Object = 0; -} - `, - // this params - ` -function test(this: Foo) { - function test2(this: Bar) {} -} - `, - // declaration merging - ` -class Foo { - prop = 1; -} -namespace Foo { - export const v = 2; -} - `, - ` -function Foo() {} -namespace Foo { - export const v = 2; -} - `, - ` -class Foo { - prop = 1; -} -interface Foo { - prop2: string; -} - `, - ` -import type { Foo } from 'bar'; - -declare module 'bar' { - export interface Foo { - x: string; - } -} - `, - // type value shadowing - ` -const x = 1; -type x = string; - `, - ` -const x = 1; -{ - type x = string; -} - `, - { - code: ` -type Foo = 1; - `, - options: [{ ignoreTypeValueShadow: true }], - globals: { - Foo: 'writable', - }, - }, - { - code: ` -type Foo = 1; - `, - options: [ - { - ignoreTypeValueShadow: false, - builtinGlobals: false, - }, - ], - globals: { - Foo: 'writable', - }, - }, - // https://github.com/typescript-eslint/typescript-eslint/issues/2360 - ` -enum Direction { - left = 'left', - right = 'right', -} - `, - // https://github.com/typescript-eslint/typescript-eslint/issues/2447 - { - code: ` -const test = 1; -type Fn = (test: string) => typeof test; - `, - options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], - }, - { - code: ` -type Fn = (Foo: string) => typeof Foo; - `, - options: [ - { - ignoreFunctionTypeParameterNameValueShadow: true, - builtinGlobals: false, - }, - ], - globals: { - Foo: 'writable', - }, - }, - // https://github.com/typescript-eslint/typescript-eslint/issues/2724 - { - code: ` - declare global { - interface ArrayConstructor {} - } - export {}; - `, - options: [{ builtinGlobals: true }], - }, - ` - declare global { - const a: string; - - namespace Foo { - const a: number; - } - } - export {}; - `, - { - code: ` - declare global { - type A = 'foo'; - - namespace Foo { - type A = 'bar'; - } - } - export {}; - `, - options: [{ ignoreTypeValueShadow: false }], - }, - { - code: ` - declare global { - const foo: string; - type Fn = (foo: number) => void; - } - export {}; - `, - options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], - }, - ` -export class Wrapper { - private constructor(private readonly wrapped: Wrapped) {} - - unwrap(): Wrapped { - return this.wrapped; - } - - static create(wrapped: Wrapped) { - return new Wrapper(wrapped); - } -} - `, - { - // https://github.com/typescript-eslint/typescript-eslint/issues/3862 - code: ` -import type { foo } from './foo'; -type bar = number; - -// 'foo' is already declared in the upper scope -// 'bar' is fine -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 }], - }, - { - code: 'const a = [].find(a => a);', - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -const a = [].find(function (a) { - return a; -}); - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const [a = [].find(a => true)] = dummy;', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const { a = [].find(a => true) } = dummy;', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'function func(a = [].find(a => true)) {}', - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -for (const a in [].find(a => true)) { -} - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -for (const a of [].find(a => true)) { -} - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: "const a = [].map(a => true).filter(a => a === 'b');", - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -const a = [] - .map(a => true) - .filter(a => a === 'b') - .find(a => a === 'c'); - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const { a } = (({ a }) => ({ a }))();', - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -const person = people.find(item => { - const person = item.name; - return person === 'foo'; -}); - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var y = bar || foo(y => y);', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var y = bar && foo(y => y);', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var z = bar(foo(z => z));', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var z = boo(bar(foo(z => z)));', - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -var match = function (person) { - return person.name === 'foo'; -}; -const person = [].find(match); - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const a = foo(x || (a => {}));', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const { a = 1 } = foo(a => {});', - options: [{ ignoreOnInitialization: true }], - }, - { - code: "const person = { ...people.find(person => person.firstName.startsWith('s')) };", - options: [{ ignoreOnInitialization: true }], - parserOptions: { ecmaVersion: 2021 }, - }, - { - code: ` -const person = { - firstName: people - .filter(person => person.firstName.startsWith('s')) - .map(person => person.firstName)[0], -}; - `, - options: [{ ignoreOnInitialization: true }], - parserOptions: { ecmaVersion: 2021 }, - }, - { - code: ` -() => { - const y = foo(y => y); -}; - `, - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const x = (x => x)();', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var y = bar || (y => y)();', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var y = bar && (y => y)();', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'var x = (x => x)((y => y)());', - options: [{ ignoreOnInitialization: true }], - }, - { - code: 'const { a = 1 } = (a => {})();', - options: [{ ignoreOnInitialization: true }], - }, - { - code: ` -() => { - const y = (y => y)(); -}; - `, - options: [{ ignoreOnInitialization: true }], - }, - { code: 'const [x = y => y] = [].map(y => y);' }, - ], - invalid: [ - { - code: ` -type T = 1; -{ - type T = 2; -} - `, - errors: [ - { - messageId: 'noShadow', - data: { - name: 'T', - }, - line: 4, - }, - ], - }, - { - code: ` -function foo() { - return function () {}; -} - `, - errors: [ - { - messageId: 'noShadow', - data: { - name: 'T', - }, - line: 3, - }, - ], - }, - { - code: ` -const x = 1; -{ - type x = string; -} - `, - options: [{ ignoreTypeValueShadow: false }], - errors: [ - { - messageId: 'noShadow', - data: { - name: 'x', - }, - line: 4, - }, - ], - }, - { - code: ` -type Foo = 1; - `, - options: [ - { - ignoreTypeValueShadow: false, - builtinGlobals: true, - }, - ], - globals: { - Foo: 'writable', - }, - errors: [ - { - messageId: 'noShadow', - data: { - name: 'Foo', - }, - line: 2, - }, - ], - }, - // https://github.com/typescript-eslint/typescript-eslint/issues/2447 - { - code: ` -const test = 1; -type Fn = (test: string) => typeof test; - `, - options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], - errors: [ - { - messageId: 'noShadow', - data: { - name: 'test', - }, - line: 3, - }, - ], - }, - { - code: ` -type Fn = (Foo: string) => typeof Foo; - `, - options: [ - { - ignoreFunctionTypeParameterNameValueShadow: false, - builtinGlobals: true, - }, - ], - globals: { - Foo: 'writable', - }, - errors: [ - { - messageId: 'noShadow', - data: { - name: 'Foo', - }, - line: 2, - }, - ], - }, - ], -}); - -ruleTester.run('no-shadow base eslint tests', rule, { - valid: [ - ` -var a = 3; -function b(x) { - a++; - return x + a; -} -setTimeout(function () { - b(a); -}, 0); - `, - ` -(function () { - var doSomething = function doSomething() {}; - doSomething(); -})(); - `, - ` -var arguments; -function bar() {} - `, - { - code: ` -var a = 3; -var b = x => { - a++; - return x + a; -}; -setTimeout(() => { - b(a); -}, 0); - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: 'class A {}', - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -class A { - constructor() { - var a; - } -} - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -(function () { - var A = class A {}; -})(); - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - var a; -} -var a; - `, - parserOptions: { ecmaVersion: 6 }, - }, // this case reports `no-redeclare`, not shadowing. - { - code: ` -{ - let a; -} -let a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - let a; -} -var a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - let a; -} -function a() {} - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - const a = 0; -} -const a = 1; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - const a = 0; -} -var a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - const a = 0; -} -function a() {} - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - let a; -} -let a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - let a; -} -var a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - let a; -} -function a() {} - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - var a; -} -let a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - var a; -} -var a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - var a; -} -function a() {} - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo(a) {} -let a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo(a) {} -var a; - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo(a) {} -function a() {} - `, - options: [{ hoist: 'never' }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - let a; -} -let a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - let a; -} -var a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - const a = 0; -} -const a = 1; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -{ - const a = 0; -} -var a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - let a; -} -let a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - let a; -} -var a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - var a; -} -let a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo() { - var a; -} -var a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo(a) {} -let a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - { - code: ` -function foo(a) {} -var a; - `, - parserOptions: { ecmaVersion: 6 }, - }, - ` -function foo() { - var Object = 0; -} - `, - { - code: ` -function foo() { - var top = 0; -} - `, - env: { browser: true }, - }, - { - code: ` -function foo(cb) { - (function (cb) { - cb(42); - })(cb); -} - `, - options: [{ allow: ['cb'] }], - }, - ], - invalid: [ - { - code: ` -function a(x) { - var b = function c() { - var x = 'foo'; - }; -} - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 4, - column: 9, - }, - ], - }, - { - code: ` -var a = x => { - var b = () => { - var x = 'foo'; - }; -}; - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 4, - column: 9, - }, - ], - }, - { - code: ` -function a(x) { - var b = function () { - var x = 'foo'; - }; -} - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 4, - column: 9, - }, - ], - }, - { - code: ` -var x = 1; -function a(x) { - return ++x; -} - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 12, - }, - ], - }, - { - code: ` -var a = 3; -function b() { - var a = 10; -} - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -var a = 3; -function b() { - var a = 10; -} -setTimeout(function () { - b(); -}, 0); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -var a = 3; -function b() { - var a = 10; - var b = 0; -} -setTimeout(function () { - b(); -}, 0); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - { - messageId: 'noShadow', - data: { name: 'b' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -var x = 1; -{ - let x = 2; -} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -let x = 1; -{ - const x = 2; -} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - let a; -} -function a() {} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - const a = 0; -} -function a() {} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - let a; -} -function a() {} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - var a; -} -function a() {} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo(a) {} -function a() {} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - let a; -} -let a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - let a; -} -var a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - let a; -} -function a() {} - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - const a = 0; -} -const a = 1; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - const a = 0; -} -var a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -{ - const a = 0; -} -function a() {} - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - let a; -} -let a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - let a; -} -var a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - let a; -} -function a() {} - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - var a; -} -let a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - var a; -} -var a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - var a; -} -function a() {} - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo(a) {} -let a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo(a) {} -var a; - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo(a) {} -function a() {} - `, - options: [{ hoist: 'all' }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function a() { - function a() {} -})(); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function a() { - class a {} -})(); - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function a() { - (function a() {}); -})(); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function a() { - (class a {}); -})(); - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function () { - var a = function (a) {}; -})(); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function () { - var a = function () { - function a() {} - }; -})(); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function () { - var a = function () { - class a {} - }; -})(); - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function () { - var a = function () { - (function a() {}); - }; -})(); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function () { - var a = function () { - (class a {}); - }; -})(); - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function () { - var a = class { - constructor() { - class a {} - } - }; -})(); - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -class A { - constructor() { - var A; - } -} - `, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'A' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -(function a() { - function a() { - function a() {} - } -})(); - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 12, - }, - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - line: 4, - column: 14, - }, - ], - }, - { - code: ` -function foo() { - var Object = 0; -} - `, - options: [{ builtinGlobals: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'Object' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo() { - var top = 0; -} - `, - options: [{ builtinGlobals: true }], - env: { browser: true }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'top' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: 'var Object = 0;', - options: [{ builtinGlobals: true }], - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'Object' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: 'var top = 0;', - options: [{ builtinGlobals: true }], - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, - env: { browser: true }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'top' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: 'var Object = 0;', - options: [{ builtinGlobals: true }], - parserOptions: { ecmaFeatures: { globalReturn: true } }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'Object' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: 'var top = 0;', - options: [{ builtinGlobals: true }], - parserOptions: { ecmaFeatures: { globalReturn: true } }, - env: { browser: true }, - errors: [ - { - messageId: 'noShadow', - data: { name: 'top' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -function foo(cb) { - (function (cb) { - cb(42); - })(cb); -} - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'cb' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 14, - }, - ], - }, - { - code: ` -import type { foo } from './foo'; -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: [ - { - messageId: 'noShadow', - data: { name: 'foo' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 18, - }, - ], - }, - { - code: ` -import { foo } from './foo'; -function doThing(foo: number, bar: number) {} - `, - options: [{ ignoreTypeValueShadow: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'foo' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 18, - }, - ], - }, - { - code: ` -interface Foo {} - -declare module 'bar' { - 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 '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; - } -} - `, - 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; - } -} - `, - errors: [ - { - messageId: 'noShadow', - data: { name: 'Foo' }, - type: AST_NODE_TYPES.Identifier, - line: 5, - column: 13, - }, - ], - }, - { - code: ` -let x = foo((x, y) => {}); -let y; - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ hoist: 'all' }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - }, - { - messageId: 'noShadow', - data: { - name: 'y', - shadowedLine: 2, - shadowedColumn: 5, - }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -const a = fn(() => { - class C { - fn() { - const a = 42; - return a; - } - } - return new C(); -}); - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - line: 5, - column: 13, - }, - ], - }, - { - code: 'function a() {}\nfoo(a => {});', - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - line: 2, - column: 5, - }, - ], - }, - { - code: ` -const a = fn(() => { - function C() { - this.fn = function () { - const a = 42; - return a; - }; - } - return new C(); -}); - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - line: 5, - column: 13, - }, - ], - }, - { - code: ` -const x = foo(() => { - const bar = () => { - return x => {}; - }; - return bar; -}); - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 4, - column: 12, - }, - ], - }, - { - code: ` -const x = foo(() => { - return { bar(x) {} }; -}); - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 16, - }, - ], - }, - { - code: ` -const x = () => { - foo(x => x); -}; - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 7, - }, - ], - }, - { - code: ` -const foo = () => { - let x; - bar(x => x); -}; - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 4, - column: 7, - }, - ], - }, - { - code: ` -foo(() => { - const x = x => x; -}); - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 13, - }, - ], - }, - { - code: ` -const foo = x => { - bar(x => {}); -}; - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 7, - }, - ], - }, - { - code: ` -let x = ((x, y) => {})(); -let y; - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ hoist: 'all' }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - }, - { - messageId: 'noShadow', - data: { name: 'y' }, - type: AST_NODE_TYPES.Identifier, - }, - ], - }, - { - code: ` -const a = (() => { - class C { - fn() { - const a = 42; - return a; - } - } - return new C(); -})(); - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'a' }, - type: AST_NODE_TYPES.Identifier, - line: 5, - column: 13, - }, - ], - }, - { - code: ` -const x = () => { - (x => x)(); -}; - `, - parserOptions: { ecmaVersion: 6 }, - options: [{ ignoreOnInitialization: true }], - errors: [ - { - messageId: 'noShadow', - data: { name: 'x' }, - type: AST_NODE_TYPES.Identifier, - line: 3, - column: 4, - }, - ], - }, - ], -}); diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts new file mode 100644 index 000000000000..3191e0d9fbfb --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts @@ -0,0 +1,1300 @@ +// The following tests are adapted from the tests in eslint. +// Original Code: https://github.com/t-mangoe/eslint/blob/c4a70499720f48e27734068074fbeee4f48fb460/tests/lib/rules/no-shadow.js +// License : https://github.com/eslint/eslint/blob/c4a70499720f48e27734068074fbeee4f48fb460/LICENSE + +'use strict'; + +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import rule from '../../../src/rules/no-shadow'; +import { RuleTester } from '../../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-shadow', rule, { + valid: [ + ` +var a = 3; +function b(x) { + a++; + return x + a; +} +setTimeout(function () { + b(a); +}, 0); + `, + ` +(function () { + var doSomething = function doSomething() {}; + doSomething(); +})(); + `, + ` +var arguments; +function bar() {} + `, + { + code: ` +var a = 3; +var b = x => { + a++; + return x + a; +}; +setTimeout(() => { + b(a); +}, 0); + `, + parserOptions: { ecmaVersion: 6 }, + }, + { code: 'class A {}', parserOptions: { ecmaVersion: 6 } }, + { + code: ` +class A { + constructor() { + var a; + } +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +(function () { + var A = class A {}; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + var a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, // this case reports `no-redeclare`, not shadowing. + { + code: ` +{ + let a; +} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +const a = 1; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +const a = 1; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + ` +function foo() { + var Object = 0; +} + `, + { + code: ` +function foo() { + var top = 0; +} + `, + env: { browser: true }, + }, + { code: 'var Object = 0;', options: [{ builtinGlobals: true }] }, + { + code: 'var top = 0;', + options: [{ builtinGlobals: true }], + env: { browser: true }, + }, + { + code: ` +function foo(cb) { + (function (cb) { + cb(42); + })(cb); +} + `, + options: [{ allow: ['cb'] }], + }, + ], + invalid: [ + { + code: ` +function a(x) { + var b = function c() { + var x = 'foo'; + }; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 12, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var a = x => { + var b = () => { + var x = 'foo'; + }; +}; + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 9, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function a(x) { + var b = function () { + var x = 'foo'; + }; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 12, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var x = 1; +function a(x) { + return ++x; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var a = 3; +function b() { + var a = 10; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var a = 3; +function b() { + var a = 10; +} +setTimeout(function () { + b(); +}, 0); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var a = 3; +function b() { + var a = 10; + var b = 0; +} +setTimeout(function () { + b(); +}, 0); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + { + messageId: 'noShadow', + data: { + name: 'b', + shadowedLine: 3, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var x = 1; +{ + let x = 2; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +let x = 1; +{ + const x = 2; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +const a = 1; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 5, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + function a() {} +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 11, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + class a {} +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 11, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + (function a() {}); +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 11, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + (class a {}); +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 11, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function (a) {}; +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + function a() {} + }; +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + class a {} + }; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + (function a() {}); + }; +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + (class a {}); + }; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = class { + constructor() { + class a {} + } + }; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +class A { + constructor() { + var A; + } +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'A', + shadowedLine: 2, + shadowedColumn: 7, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + function a() { + function a() {} + } +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 2, + shadowedColumn: 11, + }, + type: AST_NODE_TYPES.Identifier, + }, + { + messageId: 'noShadow', + data: { + name: 'a', + shadowedLine: 3, + shadowedColumn: 12, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var Object = 0; +} + `, + options: [{ builtinGlobals: true }], + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'Object', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var top = 0; +} + `, + options: [{ builtinGlobals: true }], + env: { browser: true }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'top', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var Object = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'Object', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var top = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + env: { browser: true }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'top', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var Object = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaFeatures: { globalReturn: true } }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'Object', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var top = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaFeatures: { globalReturn: true } }, + env: { browser: true }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'top', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(cb) { + (function (cb) { + cb(42); + })(cb); +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'cb', + shadowedLine: 2, + shadowedColumn: 14, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts new file mode 100644 index 000000000000..a09eae009327 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts @@ -0,0 +1,706 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import rule from '../../../src/rules/no-shadow'; +import { RuleTester } from '../../RuleTester'; + +const ruleTester = new RuleTester({ + parserOptions: { + sourceType: 'module', + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-shadow TS tests', rule, { + valid: [ + // nested conditional types + ` +export type ArrayInput = Func extends (arg0: Array) => any + ? T[] + : Func extends (...args: infer T) => any + ? T + : never; + `, + ` +function foo() { + var Object = 0; +} + `, + // this params + ` +function test(this: Foo) { + function test2(this: Bar) {} +} + `, + // declaration merging + ` +class Foo { + prop = 1; +} +namespace Foo { + export const v = 2; +} + `, + ` +function Foo() {} +namespace Foo { + export const v = 2; +} + `, + ` +class Foo { + prop = 1; +} +interface Foo { + prop2: string; +} + `, + ` +import type { Foo } from 'bar'; + +declare module 'bar' { + export interface Foo { + x: string; + } +} + `, + // type value shadowing + ` +const x = 1; +type x = string; + `, + ` +const x = 1; +{ + type x = string; +} + `, + { + code: ` +type Foo = 1; + `, + options: [{ ignoreTypeValueShadow: true }], + globals: { + Foo: 'writable', + }, + }, + { + code: ` +type Foo = 1; + `, + options: [ + { + ignoreTypeValueShadow: false, + builtinGlobals: false, + }, + ], + globals: { + Foo: 'writable', + }, + }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2360 + ` +enum Direction { + left = 'left', + right = 'right', +} + `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2447 + { + code: ` +const test = 1; +type Fn = (test: string) => typeof test; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +type Fn = (Foo: string) => typeof Foo; + `, + options: [ + { + ignoreFunctionTypeParameterNameValueShadow: true, + builtinGlobals: false, + }, + ], + globals: { + Foo: 'writable', + }, + }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2724 + { + code: ` + declare global { + interface ArrayConstructor {} + } + export {}; + `, + options: [{ builtinGlobals: true }], + }, + ` + declare global { + const a: string; + + namespace Foo { + const a: number; + } + } + export {}; + `, + { + code: ` + declare global { + type A = 'foo'; + + namespace Foo { + type A = 'bar'; + } + } + export {}; + `, + options: [{ ignoreTypeValueShadow: false }], + }, + { + code: ` + declare global { + const foo: string; + type Fn = (foo: number) => void; + } + export {}; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + ` +export class Wrapper { + private constructor(private readonly wrapped: Wrapped) {} + + unwrap(): Wrapped { + return this.wrapped; + } + + static create(wrapped: Wrapped) { + return new Wrapper(wrapped); + } +} + `, + { + // https://github.com/typescript-eslint/typescript-eslint/issues/3862 + code: ` +import type { foo } from './foo'; +type bar = number; + +// 'foo' is already declared in the upper scope +// 'bar' is fine +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 }], + }, + { + code: 'const a = [].find(a => a);', + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +const a = [].find(function (a) { + return a; +}); + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const [a = [].find(a => true)] = dummy;', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const { a = [].find(a => true) } = dummy;', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'function func(a = [].find(a => true)) {}', + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +for (const a in [].find(a => true)) { +} + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +for (const a of [].find(a => true)) { +} + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: "const a = [].map(a => true).filter(a => a === 'b');", + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +const a = [] + .map(a => true) + .filter(a => a === 'b') + .find(a => a === 'c'); + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const { a } = (({ a }) => ({ a }))();', + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +const person = people.find(item => { + const person = item.name; + return person === 'foo'; +}); + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var y = bar || foo(y => y);', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var y = bar && foo(y => y);', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var z = bar(foo(z => z));', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var z = boo(bar(foo(z => z)));', + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +var match = function (person) { + return person.name === 'foo'; +}; +const person = [].find(match); + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const a = foo(x || (a => {}));', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const { a = 1 } = foo(a => {});', + options: [{ ignoreOnInitialization: true }], + }, + { + code: "const person = { ...people.find(person => person.firstName.startsWith('s')) };", + options: [{ ignoreOnInitialization: true }], + parserOptions: { ecmaVersion: 2021 }, + }, + { + code: ` +const person = { + firstName: people + .filter(person => person.firstName.startsWith('s')) + .map(person => person.firstName)[0], +}; + `, + options: [{ ignoreOnInitialization: true }], + parserOptions: { ecmaVersion: 2021 }, + }, + { + code: ` +() => { + const y = foo(y => y); +}; + `, + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const x = (x => x)();', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var y = bar || (y => y)();', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var y = bar && (y => y)();', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'var x = (x => x)((y => y)());', + options: [{ ignoreOnInitialization: true }], + }, + { + code: 'const { a = 1 } = (a => {})();', + options: [{ ignoreOnInitialization: true }], + }, + { + code: ` +() => { + const y = (y => y)(); +}; + `, + options: [{ ignoreOnInitialization: true }], + }, + { code: 'const [x = y => y] = [].map(y => y);' }, + ], + invalid: [ + { + code: ` +type T = 1; +{ + type T = 2; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'T', + shadowedLine: 2, + shadowedColumn: 6, + }, + }, + ], + }, + { + code: ` +function foo() { + return function () {}; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'T', + shadowedLine: 2, + shadowedColumn: 14, + }, + }, + ], + }, + { + code: ` +const x = 1; +{ + type x = string; +} + `, + options: [{ ignoreTypeValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 7, + }, + }, + ], + }, + { + code: ` +type Foo = 1; + `, + options: [ + { + ignoreTypeValueShadow: false, + builtinGlobals: true, + }, + ], + globals: { + Foo: 'writable', + }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'Foo', + }, + }, + ], + }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2447 + { + code: ` +const test = 1; +type Fn = (test: string) => typeof test; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'test', + shadowedLine: 2, + shadowedColumn: 7, + }, + }, + ], + }, + { + code: ` +type Fn = (Foo: string) => typeof Foo; + `, + options: [ + { + ignoreFunctionTypeParameterNameValueShadow: false, + builtinGlobals: true, + }, + ], + globals: { + Foo: 'writable', + }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'Foo', + }, + }, + ], + }, + { + code: ` +import type { foo } from './foo'; +function doThing(foo: number) {} + `, + options: [{ ignoreTypeValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import { type foo } from './foo'; +function doThing(foo: number) {} + `, + options: [{ ignoreTypeValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import { foo } from './foo'; +function doThing(foo: number, bar: number) {} + `, + options: [{ ignoreTypeValueShadow: true }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'foo', + shadowedLine: 2, + shadowedColumn: 10, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +interface Foo {} + +declare module 'bar' { + export interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 11, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import type { Foo } from 'bar'; + +declare module 'baz' { + export interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import type { Foo } from 'bar'; + +declare module 'bar' { + export type Foo = string; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import type { Foo } from 'bar'; + +declare module 'bar' { + interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import { type Foo } from 'bar'; + +declare module 'baz' { + export interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import { type Foo } from 'bar'; + +declare module 'bar' { + export type Foo = string; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +import { type Foo } from 'bar'; + +declare module 'bar' { + interface Foo { + x: string; + } +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + shadowedLine: 2, + shadowedColumn: 15, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +let x = foo((x, y) => {}); +let y; + `, + parserOptions: { ecmaVersion: 6 }, + options: [{ hoist: 'all' }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + shadowedLine: 2, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + { + messageId: 'noShadow', + data: { + name: 'y', + shadowedLine: 3, + shadowedColumn: 5, + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + ], +}); diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 7f1dcc2effe1..17dc4446cf8e 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 c9216e70f87f..a8604b6666b2 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.29.0", + "version": "5.30.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.29.0" + "@typescript-eslint/utils": "5.30.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 0c6d3693a4e5..18b84f3bd36c 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index db362a1241d3..d3ea03b53351 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.29.0", + "version": "5.30.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,9 +44,9 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", + "@typescript-eslint/scope-manager": "5.30.0", + "@typescript-eslint/types": "5.30.0", + "@typescript-eslint/typescript-estree": "5.30.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index fa3381b1c584..b27c0515b649 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + + +### Features + +* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 b24ab83ad6e5..06791fab9e29 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.29.0", + "version": "5.30.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -38,12 +38,12 @@ "typecheck": "cd ../../ && nx typecheck @typescript-eslint/scope-manager" }, "dependencies": { - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/visitor-keys": "5.29.0" + "@typescript-eslint/types": "5.30.0", + "@typescript-eslint/visitor-keys": "5.30.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.29.0", + "@typescript-eslint/typescript-estree": "5.30.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/scope-manager/src/referencer/ClassVisitor.ts b/packages/scope-manager/src/referencer/ClassVisitor.ts index 6f5050442138..92dab53ca90a 100644 --- a/packages/scope-manager/src/referencer/ClassVisitor.ts +++ b/packages/scope-manager/src/referencer/ClassVisitor.ts @@ -293,7 +293,7 @@ class ClassVisitor extends Visitor { node.typeAnnotation.type === AST_NODE_TYPES.TSTypeReference && this.#emitDecoratorMetadata ) { - let identifier: TSESTree.Identifier; + let entityName: TSESTree.Identifier | TSESTree.ThisExpression; if ( node.typeAnnotation.typeName.type === AST_NODE_TYPES.TSQualifiedName ) { @@ -301,13 +301,15 @@ class ClassVisitor extends Visitor { while (iter.left.type === AST_NODE_TYPES.TSQualifiedName) { iter = iter.left; } - identifier = iter.left; + entityName = iter.left; } else { - identifier = node.typeAnnotation.typeName; + entityName = node.typeAnnotation.typeName; } if (withDecorators) { - this.#referencer.currentScope().referenceDualValueType(identifier); + if (entityName.type === AST_NODE_TYPES.Identifier) { + this.#referencer.currentScope().referenceDualValueType(entityName); + } if (node.typeAnnotation.typeParameters) { this.visitType(node.typeAnnotation.typeParameters); diff --git a/packages/scope-manager/src/referencer/TypeVisitor.ts b/packages/scope-manager/src/referencer/TypeVisitor.ts index 0d345a149a29..4b39676850db 100644 --- a/packages/scope-manager/src/referencer/TypeVisitor.ts +++ b/packages/scope-manager/src/referencer/TypeVisitor.ts @@ -256,15 +256,20 @@ class TypeVisitor extends Visitor { // a type query `typeof foo` is a special case that references a _non-type_ variable, protected TSTypeQuery(node: TSESTree.TSTypeQuery): void { - if (node.exprName.type === AST_NODE_TYPES.Identifier) { - this.#referencer.currentScope().referenceValue(node.exprName); - } else { - let expr = node.exprName.left; - while (expr.type !== AST_NODE_TYPES.Identifier) { - expr = expr.left; + let entityName: TSESTree.Identifier | TSESTree.ThisExpression; + if (node.exprName.type === AST_NODE_TYPES.TSQualifiedName) { + let iter = node.exprName; + while (iter.left.type === AST_NODE_TYPES.TSQualifiedName) { + iter = iter.left; } - this.#referencer.currentScope().referenceValue(expr); + entityName = iter.left; + } else { + entityName = node.exprName; } + if (entityName.type === AST_NODE_TYPES.Identifier) { + this.#referencer.currentScope().referenceValue(entityName); + } + this.visit(node.typeParameters); } diff --git a/packages/scope-manager/tests/fixtures/decorators/typeof-this.ts b/packages/scope-manager/tests/fixtures/decorators/typeof-this.ts new file mode 100644 index 000000000000..1b68d92331b5 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/typeof-this.ts @@ -0,0 +1,5 @@ +function decorator() {} +@decorator +class Foo { + bar(baz: typeof this) {} +} diff --git a/packages/scope-manager/tests/fixtures/decorators/typeof-this.ts.shot b/packages/scope-manager/tests/fixtures/decorators/typeof-this.ts.shot new file mode 100644 index 000000000000..39c4468e53c7 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/typeof-this.ts.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`decorators typeof-this 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"decorator">, + node: FunctionDeclaration$1, + }, + ], + name: "decorator", + references: Array [ + Reference$1 { + identifier: Identifier<"decorator">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"Foo">, + node: ClassDeclaration$2, + }, + ], + name: "Foo", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$5 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"Foo">, + node: ClassDeclaration$2, + }, + ], + name: "Foo", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$6 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$7 { + defs: Array [ + ParameterDefinition$4 { + name: Identifier<"baz">, + node: FunctionExpression$3, + }, + ], + name: "baz", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "Foo" => Variable$4, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ClassScope$3 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [], + set: Map { + "Foo" => Variable$5, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$5, + ], + }, + FunctionScope$4 { + block: FunctionExpression$3, + isStrict: true, + references: Array [], + set: Map { + "arguments" => Variable$6, + "baz" => Variable$7, + }, + type: "function", + upper: ClassScope$3, + variables: Array [ + Variable$6, + Variable$7, + ], + }, + ], +} +`; diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index c5f34401a775..9d5d0b22b9d7 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + + +### Features + +* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts b/packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts new file mode 100644 index 000000000000..6cad5147a8ae --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts @@ -0,0 +1,2 @@ +let self: typeof this; +let foo: typeof this.foo; diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 064f4b54511a..967a069cb933 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "5.29.0", + "version": "5.30.0", "private": true } diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index dbba91203f01..ea5f1d522fae 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/type-utils + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 112a91a8d3f8..ea61c1baf401 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "5.29.0", + "version": "5.30.0", "description": "Type utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.29.0", + "@typescript-eslint/utils": "5.30.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.29.0", + "@typescript-eslint/parser": "5.30.0", "typescript": "*" }, "peerDependencies": { diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 65c851bf96b2..bfa5122742a5 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 25ce9ef5212d..4010773beadf 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.29.0", + "version": "5.30.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 47c0a2f91dca..38cc3c901986 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + + +### Features + +* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 6b56c2aa343a..23980e442a26 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.29.0", + "version": "5.30.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.29.0", - "@typescript-eslint/visitor-keys": "5.29.0", + "@typescript-eslint/types": "5.30.0", + "@typescript-eslint/visitor-keys": "5.30.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -58,7 +58,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "5.29.0", + "@typescript-eslint/shared-fixtures": "5.30.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 864f85d2cd2b..be09a2b387db 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -20,6 +20,7 @@ import { isComputedProperty, isESTreeClassMember, isOptional, + isThisInTypeQuery, TSError, unescapeStringLiteralText, } from './node-utils'; @@ -799,6 +800,13 @@ export class Converter { } case SyntaxKind.Identifier: { + if (isThisInTypeQuery(node)) { + // special case for `typeof this.foo` - TS emits an Identifier for `this` + // but we want to treat it as a ThisExpression for consistency + return this.createNode(node, { + type: AST_NODE_TYPES.ThisExpression, + }); + } return this.createNode(node, { type: AST_NODE_TYPES.Identifier, name: node.text, diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 132971f66329..1f7b75651d51 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -662,3 +662,29 @@ export function firstDefined( } return undefined; } + +export function identifierIsThisKeyword(id: ts.Identifier): boolean { + return id.originalKeywordKind === SyntaxKind.ThisKeyword; +} + +export function isThisIdentifier( + node: ts.Node | undefined, +): node is ts.Identifier { + return ( + !!node && + node.kind === SyntaxKind.Identifier && + identifierIsThisKeyword(node as ts.Identifier) + ); +} + +export function isThisInTypeQuery(node: ts.Node): boolean { + if (!isThisIdentifier(node)) { + return false; + } + + while (ts.isQualifiedName(node.parent) && node.parent.left === node) { + node = node.parent; + } + + return node.parent.kind === SyntaxKind.TypeQuery; +} diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 666909b5a714..82d5ace2c2ae 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -149,7 +149,10 @@ export interface EstreeToTsNodeTypes { [AST_NODE_TYPES.TemplateLiteral]: | ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression; - [AST_NODE_TYPES.ThisExpression]: ts.ThisExpression | ts.KeywordTypeNode; + [AST_NODE_TYPES.ThisExpression]: + | ts.ThisExpression + | ts.KeywordTypeNode + | ts.Identifier; [AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement; [AST_NODE_TYPES.TryStatement]: ts.TryStatement; [AST_NODE_TYPES.TSAbstractPropertyDefinition]: ts.PropertyDeclaration; diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index e74d1daf3ff0..f8c434587089 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,6 +1,6 @@ // babel types are something we don't really care about /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-plus-operands */ -import type { File, Program } from '@babel/types'; +import type { File, Identifier, Program, TSTypeQuery } from '@babel/types'; import { AST_NODE_TYPES, TSESTree } from '../../src/ts-estree'; import { deeplyCopy, omitDeep } from '../../tools/test-utils'; @@ -295,6 +295,30 @@ export function preprocessBabylonAST(ast: File): any { delete node.loc.start.index; } }, + /** + * ts-estree: `this` in `typeof this` has been converted from `Identifier` to `ThisExpression` + * @see https://github.com/typescript-eslint/typescript-eslint/pull/4382 + */ + TSTypeQuery(node: any) { + const { exprName } = node as TSTypeQuery; + let identifier: Identifier; + if (exprName.type === AST_NODE_TYPES.TSImportType) { + return; + } else if (exprName.type === AST_NODE_TYPES.TSQualifiedName) { + let iter = exprName; + while (iter.left.type === AST_NODE_TYPES.TSQualifiedName) { + iter = iter.left; + } + identifier = iter.left; + } else { + identifier = exprName; + } + + if (identifier.name === 'this') { + (identifier.type as string) = AST_NODE_TYPES.ThisExpression; + delete (identifier as { name?: string }).name; + } + }, }, ); } diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 16e81894b386..6cabb17f5166 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -2786,6 +2786,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof-this.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof-with-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/union-intersection.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot new file mode 100644 index 000000000000..c708076ab555 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot @@ -0,0 +1,530 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript types typeof-this.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "self", + "range": Array [ + 4, + 21, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "exprName": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "ThisExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 21, + ], + "type": "TSTypeQuery", + "typeParameters": undefined, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 47, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 30, + 47, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "exprName": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 39, + 43, + ], + "type": "ThisExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 39, + 47, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 32, + 47, + ], + "type": "TSTypeQuery", + "typeParameters": undefined, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 27, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 23, + 48, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "value": "self", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 39, + 43, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index e8ad29f2e0ef..fbe1b5ac54c0 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/utils + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/utils diff --git a/packages/utils/package.json b/packages/utils/package.json index 66bc99ae8e97..985d528f6d09 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "5.29.0", + "version": "5.30.0", "description": "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.29.0", - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", + "@typescript-eslint/scope-manager": "5.30.0", + "@typescript-eslint/types": "5.30.0", + "@typescript-eslint/typescript-estree": "5.30.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 1628e703cfe7..f1a0d25a23b8 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 fb4bc736810f..83fa774d33b5 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.29.0", + "version": "5.30.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.29.0", + "@typescript-eslint/types": "5.30.0", "eslint-visitor-keys": "^3.3.0" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index 4cd34cecedaf..c9a378335f74 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package @typescript-eslint/website-eslint + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **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 e3a23f483082..0fa19cf15497 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.29.0", + "version": "5.30.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,19 +16,19 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/utils": "5.29.0" + "@typescript-eslint/types": "5.30.0", + "@typescript-eslint/utils": "5.30.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", "@rollup/pluginutils": "^4.2.1", - "@typescript-eslint/eslint-plugin": "5.29.0", - "@typescript-eslint/parser": "5.29.0", - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", - "@typescript-eslint/visitor-keys": "5.29.0", + "@typescript-eslint/eslint-plugin": "5.30.0", + "@typescript-eslint/parser": "5.30.0", + "@typescript-eslint/scope-manager": "5.30.0", + "@typescript-eslint/typescript-estree": "5.30.0", + "@typescript-eslint/visitor-keys": "5.30.0", "eslint": "*", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index c4fa01f90057..225fe85a7050 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.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) + +**Note:** Version bump only for package website + + + + + # [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index ff4ea8fa6853..76c205b4f0e4 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -1,4 +1,12 @@ [ + { + "id": "Indeed", + "image": "https://images.opencollective.com/indeed/4b8725e/logo.png", + "name": "Indeed", + "tier": "sponsor", + "totalDonations": 1005000, + "website": "https://Indeed.com" + }, { "id": "Nx (by Nrwl)", "image": "https://images.opencollective.com/nx/0efbe42/logo.png", @@ -55,6 +63,13 @@ "totalDonations": 60000, "website": "https://www.gitbook.com" }, + { + "id": "GitHub", + "image": "https://images.opencollective.com/guest-f9980024/avatar.png", + "name": "GitHub", + "tier": "supporter", + "totalDonations": 56674 + }, { "id": "Future Processing", "image": "https://images.opencollective.com/future-processing/1410d26/logo.png", @@ -158,6 +173,13 @@ "totalDonations": 10000, "website": "https://www.theguardian.com/" }, + { + "id": "Yuta Fukazawa", + "image": "https://images.opencollective.com/yuta-fukazawa/a337601/avatar.png", + "name": "Yuta Fukazawa", + "tier": "contributor", + "totalDonations": 10000 + }, { "id": "Tripwire, Inc.", "image": "https://images.opencollective.com/tripwire/7599e30/logo.png", @@ -205,14 +227,6 @@ "totalDonations": 5000, "website": "https://backscattering.de" }, - { - "id": "Indeed", - "image": "https://images.opencollective.com/indeed/4b8725e/logo.png", - "name": "Indeed", - "tier": "contributor", - "totalDonations": 5000, - "website": "https://Indeed.com" - }, { "id": "Corellium", "image": "https://images.opencollective.com/corellium/aa8c228/logo.png", diff --git a/packages/website/docusaurusConfig.ts b/packages/website/docusaurusConfig.ts index ed8d4deaa0cf..ac050430f533 100644 --- a/packages/website/docusaurusConfig.ts +++ b/packages/website/docusaurusConfig.ts @@ -5,6 +5,7 @@ import type { UserThemeConfig as ThemeCommonConfig } from '@docusaurus/theme-com import type { UserThemeConfig as AlgoliaThemeConfig } from '@docusaurus/theme-search-algolia'; import type { Config } from '@docusaurus/types'; +import { rulesMeta } from './rulesMeta'; import npm2yarnPlugin from '@docusaurus/remark-plugin-npm2yarn'; import tabsPlugin from 'remark-docusaurus-tabs'; import { addRuleAttributesList } from './plugins/add-rule-attributes-list'; @@ -58,7 +59,9 @@ const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = { metadata: [ { name: 'msapplication-TileColor', content: '#443fd4' }, { name: 'theme-color', content: '#443fd4' }, + { name: 'twitter:image:alt', content: 'Typescript-eslint logo' }, ], + image: 'img/logo-twitter-card.png', navbar: { title: 'TypeScript ESLint', // hideOnScroll: true, @@ -175,6 +178,9 @@ const config: Config = { projectName: 'typescript-eslint', clientModules: [require.resolve('./src/clientModules.js')], presets: [['classic', presetClassicOptions]], + customFields: { + rules: rulesMeta, + }, plugins: [ require.resolve('./webpack.plugin'), ['@docusaurus/plugin-content-docs', pluginContentDocsOptions], diff --git a/packages/website/package.json b/packages/website/package.json index ab385d0e7c69..8fd2a61e4d6b 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "5.29.0", + "version": "5.30.0", "private": true, "scripts": { "build": "docusaurus build", @@ -20,7 +20,7 @@ "@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.21", "@docusaurus/theme-common": "2.0.0-beta.21", "@mdx-js/react": "1.6.22", - "@typescript-eslint/website-eslint": "5.29.0", + "@typescript-eslint/website-eslint": "5.30.0", "clsx": "^1.1.1", "eslint": "*", "json5": "^2.2.1", @@ -37,7 +37,7 @@ "@types/react": "^18.0.9", "@types/react-helmet": "^6.1.5", "@types/react-router-dom": "^5.3.3", - "@typescript-eslint/eslint-plugin": "5.29.0", + "@typescript-eslint/eslint-plugin": "5.30.0", "copy-webpack-plugin": "^11.0.0", "cypress": "8.3.0", "cypress-axe": "^0.14.0", diff --git a/packages/website/plugins/add-rule-attributes-list.ts b/packages/website/plugins/add-rule-attributes-list.ts index 381ca2638a6b..febbfc355576 100644 --- a/packages/website/plugins/add-rule-attributes-list.ts +++ b/packages/website/plugins/add-rule-attributes-list.ts @@ -1,3 +1,4 @@ +import type * as unist from 'unist'; import type * as mdast from 'mdast'; import type { Plugin } from 'unified'; @@ -13,191 +14,25 @@ const addRuleAttributesList: Plugin = () => { if (rule == null) { return; } - const config = ((): 'recommended' | 'strict' | null => { - switch (rule.meta.docs?.recommended) { - case 'error': - case 'warn': - return 'recommended'; - - case 'strict': - return 'strict'; - - default: - return null; - } - })(); - const autoFixable = rule.meta.fixable != null; - const suggestionFixable = rule.meta.hasSuggestions === true; - const requiresTypeInfo = rule.meta.docs?.requiresTypeChecking === true; - - const parent = root as mdast.Parent; - /* - This just outputs a list with a heading like: - -## Attributes - -- [ ] Config - - [ ] ✅ Recommended - - [ ] 🔒 Strict -- [ ] Fixable - - [ ] 🔧 Automated Fixer (`--fix`) - - [ ] 🛠 Suggestion Fixer -- [ ] 💭 Requires type information - */ - const heading = Heading({ - depth: 2, - text: 'Attributes', - }); - const ruleAttributes = List({ - children: [ - NestedList({ - checked: config != null, - children: [ - ListItem({ - checked: config === 'recommended', - text: '✅ Recommended', - }), - ListItem({ - checked: config === 'strict' || config === 'recommended', - text: '🔒 Strict', - }), - ], - text: 'Included in configs', - }), - NestedList({ - checked: autoFixable || suggestionFixable, - children: [ - ListItem({ - checked: autoFixable, - text: '🔧 Automated Fixer', - }), - ListItem({ - checked: suggestionFixable, - text: '🛠 Suggestion Fixer', - }), - ], - text: 'Fixable', - }), - ListItem({ - checked: requiresTypeInfo, - text: '💭 Requires type information', - }), - ], - }); + const parent = root as unist.Parent; const h2Idx = parent.children.findIndex( - child => child.type === 'heading' && child.depth === 2, + child => child.type === 'heading' && (child as mdast.Heading).depth === 2, ); + // The actual content will be injected on client side. + const attrNode = { + type: 'jsx', + value: ``, + }; if (h2Idx != null) { // insert it just before the first h2 in the doc // this should be just after the rule's description - parent.children.splice(h2Idx, 0, heading, ruleAttributes); + parent.children.splice(h2Idx, 0, attrNode); } else { // failing that, add it to the end - parent.children.push(heading, ruleAttributes); + parent.children.push(attrNode); } }; }; -function Heading({ - depth, - text, - id = text.toLowerCase(), -}: { - depth: mdast.Heading['depth']; - id?: string; - text: string; -}): mdast.Heading { - return { - type: 'heading', - depth, - children: [ - { - type: 'text', - value: text, - }, - ], - data: { - hProperties: { - id, - }, - id, - }, - }; -} - -function Paragraph({ text }: { text: string }): mdast.Paragraph { - return { - type: 'paragraph', - children: [ - { - type: 'text', - value: text, - }, - ], - }; -} - -function ListItem({ - checked, - text, -}: { - checked: boolean; - text: string; -}): mdast.ListItem { - return { - type: 'listItem', - spread: false, - checked: checked, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: text, - }, - ], - }, - ], - }; -} - -function NestedList({ - children, - checked, - text, -}: { - children: mdast.ListItem[]; - checked: boolean; - text: string; -}): mdast.ListItem { - return { - type: 'listItem', - spread: false, - checked: checked, - children: [ - Paragraph({ - text, - }), - List({ - children, - }), - ], - data: { - className: 'test', - }, - }; -} - -function List({ children }: { children: mdast.ListItem[] }): mdast.List { - return { - type: 'list', - ordered: false, - start: null, - spread: false, - children, - }; -} - export { addRuleAttributesList }; diff --git a/packages/website/rulesMeta.ts b/packages/website/rulesMeta.ts new file mode 100644 index 000000000000..8aa5f317469f --- /dev/null +++ b/packages/website/rulesMeta.ts @@ -0,0 +1,15 @@ +import * as eslintPlugin from '@typescript-eslint/eslint-plugin'; + +export const rulesMeta = Object.entries(eslintPlugin.rules).map( + ([name, content]) => ({ + name, + type: content.meta.type, + docs: content.meta.docs, + fixable: content.meta.fixable, + hasSuggestions: content.meta.hasSuggestions, + deprecated: content.meta.deprecated, + replacedBy: content.meta.replacedBy, + }), +); + +export type RulesMeta = typeof rulesMeta; diff --git a/packages/website/src/components/Playground.module.css b/packages/website/src/components/Playground.module.css index 771da57e32d7..982899552094 100644 --- a/packages/website/src/components/Playground.module.css +++ b/packages/website/src/components/Playground.module.css @@ -103,6 +103,5 @@ .astViewer { height: auto; - max-height: 30rem; } } diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx new file mode 100644 index 000000000000..6629637a44b4 --- /dev/null +++ b/packages/website/src/components/RulesTable/index.tsx @@ -0,0 +1,196 @@ +import React, { useState, useMemo } from 'react'; +import clsx from 'clsx'; +import Link from '@docusaurus/Link'; +import { useRulesMeta } from '@site/src/hooks/useRulesMeta'; +import type { RulesMeta } from '@site/rulesMeta'; + +import styles from './styles.module.css'; + +function interpolateCode(text: string): (JSX.Element | string)[] | string { + const fragments = text.split(/`(.*?)`/); + if (fragments.length === 1) { + return text; + } + return fragments.map((v, i) => (i % 2 === 0 ? v : {v})); +} + +function RuleRow({ rule }: { rule: RulesMeta[number] }): JSX.Element | null { + if (!rule.docs || !rule.docs.url) { + return null; + } + return ( + + + + @typescript-eslint/{rule.name} + +
+ {interpolateCode(rule.docs.description)} + + + {rule.docs.recommended === 'strict' + ? '🔒' + : rule.docs.recommended + ? '✅' + : ''} + + + {rule.fixable ? '🔧\n' : '\n'} + {rule.hasSuggestions ? '🛠' : ''} + + + {rule.docs.requiresTypeChecking ? '💭' : ''} + + + ); +} + +const filterModes = ['neutral', 'include', 'exclude'] as const; +type FilterMode = typeof filterModes[number]; + +function RuleFilterCheckBox({ + label, + setMode, + mode, +}: { + label: string; + setMode: (mode: FilterMode) => void; + mode: FilterMode; +}): JSX.Element { + const toNextMode = (): void => + setMode(filterModes[(filterModes.indexOf(mode) + 1) % filterModes.length]); + return ( +
  • + +
  • + ); +} + +function match(mode: FilterMode, value: boolean): boolean | undefined { + if (mode === 'exclude') { + return !value; + } + if (mode === 'include') { + return value; + } + return undefined; +} + +export default function RulesTable({ + extensionRules, +}: { + extensionRules?: boolean; +}): JSX.Element { + const rules = useRulesMeta(); + const [showRecommended, setShowRecommended] = useState('neutral'); + const [showStrict, setShowStrict] = useState('neutral'); + const [showFixable, setShowFixable] = useState('neutral'); + const [showHasSuggestions, setShowHasSuggestion] = + useState('neutral'); + const [showTypeCheck, setShowTypeCheck] = useState('neutral'); + const relevantRules = useMemo( + () => + rules + .filter(r => !!extensionRules === !!r.docs?.extendsBaseRule) + .filter(r => { + const opinions = [ + match( + showRecommended, + r.docs?.recommended === 'error' || r.docs?.recommended === 'warn', + ), + match(showStrict, r.docs?.recommended === 'strict'), + match(showFixable, !!r.fixable), + match(showHasSuggestions, !!r.hasSuggestions), + match(showTypeCheck, !!r.docs?.requiresTypeChecking), + ].filter((o): o is boolean => o !== undefined); + return opinions.every(o => o); + }), + [ + rules, + extensionRules, + showRecommended, + showStrict, + showFixable, + showHasSuggestions, + showTypeCheck, + ], + ); + return ( + <> +
      + { + setShowRecommended(newMode); + + if (newMode === 'include' && showStrict === 'include') { + setShowStrict('exclude'); + } + }} + label="✅ recommended" + /> + { + setShowStrict(newMode); + + if (newMode === 'include' && showRecommended === 'include') { + setShowRecommended('exclude'); + } + }} + label="🔒 strict" + /> + + + +
    + + + + + + + + + + + {relevantRules.map(rule => ( + + ))} + +
    Rule✅{'\n'}🔒🔧{'\n'}🛠💭
    + + ); +} diff --git a/packages/website/src/components/RulesTable/styles.module.css b/packages/website/src/components/RulesTable/styles.module.css new file mode 100644 index 000000000000..6e2cc5ac27e3 --- /dev/null +++ b/packages/website/src/components/RulesTable/styles.module.css @@ -0,0 +1,119 @@ +:root { + --gray-border: var(--ifm-color-secondary-dark); + --gray-border-shadow: var(--ifm-color-secondary-dark); + --blue-bg: rgba(148, 197, 225, 0.25); + --blue-border: var(--ifm-color-primary-lighter); + --blue-border-shadow: var(--ifm-color-primary-lightest); + --red-bg: rgba(250, 56, 62, 0.25); + --red-border: rgba(198, 10, 10, 0.4); + --red-border-shadow: rgba(255, 0, 0, 0.4); +} + +[data-theme='dark'] { + --gray-border-shadow: var(--ifm-color-secondary); + --blue-bg: rgba(35, 78, 128, 0.5); + --blue-border: var(--ifm-color-primary-dark); + --red-border: rgba(255, 0, 0, 0.3); + --red-border-shadow: rgb(235, 107, 107); +} + +.checkboxList { + flex-wrap: wrap; +} + +.checkboxListItem { + user-select: none; + white-space: nowrap; + height: 32px; + font-size: 0.8rem; + margin-top: 0.5rem; + display: inline-flex; + margin-right: 0.5rem; +} + +.checkboxListItem:last-child { + margin-right: 0; +} + +.checkboxLabel { + display: flex; + align-items: center; + cursor: pointer; + line-height: 1.5; + border-radius: 4px; + padding: 0.275rem 0.8rem; + opacity: 0.85; + transition: opacity 200ms ease-out; + border: 2px solid var(--gray-border); + background-color: var(--ifm-background-color); +} + +[data-theme='dark'] .checkboxLabel { + border: 2px solid #666666; +} + +.checkboxLabel:hover { + opacity: 1; + box-shadow: 0 0 2px 1px var(--gray-border-shadow); +} + +[data-theme='dark'] .checkboxLabel:hover { + box-shadow: 0 0 2px 0 var(--gray-border-shadow); +} + +.checkboxLabel:focus-visible { + outline: 2px solid currentColor; +} + +.checkboxLabel.activated { + opacity: 0.9; + background-color: var(--blue-bg); + border: 2px solid var(--blue-border); +} + +.checkboxLabel.activated:hover { + opacity: 0.75; + box-shadow: 0 0 2px 1px var(--blue-border-shadow); +} + +.checkboxLabel.deactivated { + opacity: 0.9; + background-color: var(--red-bg); + border: 2px solid var(--red-border); +} + +.checkboxLabel.deactivated:hover { + opacity: 0.75; + box-shadow: 0 0 2px 1px var(--red-border-shadow); +} + +.visual::after { + content: '✖'; + display: inline-block; + margin-left: 0; + opacity: 0; + width: 0; + transition: margin-left var(--ifm-transition-fast), + opacity var(--ifm-transition-fast), width var(--ifm-transition-fast); +} + +.visual.visual-exclude::after, +.visual.visual-include::after { + margin-left: -0.5rem; + opacity: 1; + width: 1rem; +} + +.visual.visual-include::after { + content: '✔'; +} + +.rulesTable, +.ruleCol { + width: 100%; +} + +.attrCol { + min-width: 2.5em; + text-align: center; +} diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index eb54143bad46..4eec5f356957 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -63,6 +63,7 @@ export const useSandboxServices = ( formatOnPaste: true, formatOnType: true, wrappingIndent: 'same', + hover: { above: false }, }, acquireTypes: false, compilerOptions: compilerOptions, diff --git a/packages/website/src/hooks/useRulesMeta.ts b/packages/website/src/hooks/useRulesMeta.ts new file mode 100644 index 000000000000..fc6ca0d230d0 --- /dev/null +++ b/packages/website/src/hooks/useRulesMeta.ts @@ -0,0 +1,12 @@ +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import type { RulesMeta } from '@site/rulesMeta'; + +export function useRulesMeta(): RulesMeta { + const { + siteConfig: { customFields }, + } = useDocusaurusContext(); + if (!customFields) { + throw new Error('Custom fields not found in config'); + } + return customFields.rules as RulesMeta; +} diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.module.css b/packages/website/src/theme/MDXComponents/RuleAttributes.module.css new file mode 100644 index 000000000000..97c07287baba --- /dev/null +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.module.css @@ -0,0 +1,7 @@ +.taskList { + list-style: none; +} + +:not(.taskList > li) > .taskList { + padding-left: 0; +} diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx new file mode 100644 index 000000000000..74726a63fc37 --- /dev/null +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -0,0 +1,73 @@ +import React from 'react'; +import type { TSESLint } from '@typescript-eslint/utils'; +import { useRulesMeta } from '@site/src/hooks/useRulesMeta'; + +import styles from './RuleAttributes.module.css'; + +export function RuleAttributes({ name }: { name: string }): JSX.Element | null { + const rules = useRulesMeta(); + const rule = rules.find(rule => rule.name === name); + if (!rule) { + return null; + } + return ( + <> +

    Attributes

    +
      +
    • + + Included in configs +
        +
      • + + ✅ Recommended +
      • +
      • + + 🔒 Strict +
      • +
      +
    • +
    • + + Fixable +
        +
      • + + 🔧 Automated Fixer +
      • +
      • + + 🛠 Suggestion Fixer +
      • +
      +
    • +
    • + + 💭 Requires type information +
    • +
    + + ); +} diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx new file mode 100644 index 000000000000..2ef24ef1c72f --- /dev/null +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -0,0 +1,8 @@ +import MDXComponents from '@theme-original/MDXComponents'; +import { RuleAttributes } from './RuleAttributes'; + +// eslint-disable-next-line import/no-default-export +export default { + ...MDXComponents, + 'rule-attributes': RuleAttributes, +}; diff --git a/packages/website/static/img/logo-twitter-card.png b/packages/website/static/img/logo-twitter-card.png new file mode 100644 index 000000000000..b63a38262991 Binary files /dev/null and b/packages/website/static/img/logo-twitter-card.png differ diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index 2dd71ec3f252..13f1948404e4 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -16,5 +16,11 @@ }, "types": ["@docusaurus/module-type-aliases", "@docusaurus/theme-classic"] }, - "include": ["src/", "plugins/", "typings", "./docusaurusConfig.ts"] + "include": [ + "src/", + "plugins/", + "typings", + "./docusaurusConfig.ts", + "./rulesMeta.ts" + ] } diff --git a/yarn.lock b/yarn.lock index 47b62ee736e9..c9611ce28e35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2213,39 +2213,39 @@ resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== -"@lerna/add@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-5.1.2.tgz#062b9b435ebada410f32d05eca092f4d14ca0dc2" - integrity sha512-8WT+HylIQFTz/6kzdKMn49sWYX5n2SXYmsOsakSkc5OJk49X29W9wzEl89uCjO1fhz/jVK8+wcFhfnRPxen1cg== - dependencies: - "@lerna/bootstrap" "5.1.2" - "@lerna/command" "5.1.2" - "@lerna/filter-options" "5.1.2" - "@lerna/npm-conf" "5.1.1" - "@lerna/validation-error" "5.1.2" +"@lerna/add@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-5.1.4.tgz#ddd21385b0a2f427b1bf1dd193e7e56f77bb3544" + integrity sha512-kysQaV0+6aFtT0rkbaeuP6qb0vYDwo7TiC+Og4STyXxv2mHXi3F8r6Z9xXNUn8LPi29gaCmB8DLmbEGlTBM4xg== + dependencies: + "@lerna/bootstrap" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/filter-options" "5.1.4" + "@lerna/npm-conf" "5.1.4" + "@lerna/validation-error" "5.1.4" dedent "^0.7.0" npm-package-arg "^8.1.0" p-map "^4.0.0" pacote "^13.4.1" semver "^7.3.4" -"@lerna/bootstrap@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-5.1.2.tgz#917679f719b94ff08f52def8fc0f96956fa97bfc" - integrity sha512-fUCLyhQ5zj8Dd82RVliz3CW+BaszQFrcpuOE0KL5SEqDhwY6Fm79CFS9Ls/OqF2tB6C8eWHj7kAc4lnXT1JIng== - dependencies: - "@lerna/command" "5.1.2" - "@lerna/filter-options" "5.1.2" - "@lerna/has-npm-version" "5.1.1" - "@lerna/npm-install" "5.1.2" - "@lerna/package-graph" "5.1.2" - "@lerna/pulse-till-done" "5.1.2" - "@lerna/rimraf-dir" "5.1.2" - "@lerna/run-lifecycle" "5.1.2" - "@lerna/run-topologically" "5.1.2" - "@lerna/symlink-binary" "5.1.2" - "@lerna/symlink-dependencies" "5.1.2" - "@lerna/validation-error" "5.1.2" +"@lerna/bootstrap@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-5.1.4.tgz#da60d4d329884d9153b536390aeb10c944e004a4" + integrity sha512-uCP0WdxGCGAGkwcuhv2nLqLByq9WJ5yr+93A8T15xZJfQsXLtYjjlivIe35MjS77eR+krwl5uY6WmGPJ33+afg== + dependencies: + "@lerna/command" "5.1.4" + "@lerna/filter-options" "5.1.4" + "@lerna/has-npm-version" "5.1.4" + "@lerna/npm-install" "5.1.4" + "@lerna/package-graph" "5.1.4" + "@lerna/pulse-till-done" "5.1.4" + "@lerna/rimraf-dir" "5.1.4" + "@lerna/run-lifecycle" "5.1.4" + "@lerna/run-topologically" "5.1.4" + "@lerna/symlink-binary" "5.1.4" + "@lerna/symlink-dependencies" "5.1.4" + "@lerna/validation-error" "5.1.4" "@npmcli/arborist" "5.2.0" dedent "^0.7.0" get-port "^5.1.1" @@ -2257,100 +2257,100 @@ p-waterfall "^2.1.1" semver "^7.3.4" -"@lerna/changed@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-5.1.2.tgz#60e6265b2602c02316fe478e48f1cf09352e6efb" - integrity sha512-A9M32fQ9DHQfwu8i7iiCXKS1YE3UEgNnB9qNHqwsI+qyV8gU8ylzsBegL8eSjFsXrjTvHRFML99FAk7QnuOWqg== +"@lerna/changed@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-5.1.4.tgz#00e660f991f0d76104a467dbebea1c232c0ef647" + integrity sha512-XwA3+pw5keO2CyjobLN8dU7mvGbzB3FD+LtLPI/zk7UbNIbl7V6uaIkoPJIdTWwP1e6S1BnGCVsAMtwQ980gTA== dependencies: - "@lerna/collect-updates" "5.1.2" - "@lerna/command" "5.1.2" - "@lerna/listable" "5.1.2" - "@lerna/output" "5.1.2" + "@lerna/collect-updates" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/listable" "5.1.4" + "@lerna/output" "5.1.4" -"@lerna/check-working-tree@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-5.1.2.tgz#8605315a407494dc22d93e1e42f4376acc797d6c" - integrity sha512-9O5ciNuym0Ne56i0BCcI/YyGt6PTsYfoFWIUhugSPywNZLBGJxq9lq2DQWnQe1ACa1JvRfC2T6BpdaLiTXYL3Q== +"@lerna/check-working-tree@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-5.1.4.tgz#d875eaedcf370603e7c73665ded28783ae01dcb5" + integrity sha512-yFkRmZd25viwxyyOHZd3g7k2Od2Mk0Sf15fol3h/a7P0rUMf6UaMoGo2qlyo+DS51sz+eNalMmFKLpRrDXcSSw== dependencies: - "@lerna/collect-uncommitted" "5.1.2" - "@lerna/describe-ref" "5.1.2" - "@lerna/validation-error" "5.1.2" + "@lerna/collect-uncommitted" "5.1.4" + "@lerna/describe-ref" "5.1.4" + "@lerna/validation-error" "5.1.4" -"@lerna/child-process@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-5.1.1.tgz#a22764ab030fb0121f244f14e7c5ed62d5163fc1" - integrity sha512-hPBDbqZws2d3GehCuYZ0vZwd/SRthwDIPWGkd74xevdoLxka3Y/y5IdogZz3V9cc6p6bdP6ZHbBSumEX+VIhxA== +"@lerna/child-process@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-5.1.4.tgz#164322198c27698fde9d913da120afa6501e390e" + integrity sha512-F7xP+bEdkE3JTyKz0t33QA5v2meXZrQQ0JmHa7/AlEg6D2r7gQ8UHSHuSUiNfX4drjpePe/9XaZylj01KLcx/w== dependencies: chalk "^4.1.0" execa "^5.0.0" strong-log-transformer "^2.1.0" -"@lerna/clean@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-5.1.2.tgz#1a4ac1f8d8d203b1246652e5ca316e07ceed26f4" - integrity sha512-3YTQDQIOSuSVAaE1R8rXDvz/+hpEv1FuaXLZ7+g7JUTJAP6ZH5JF9+hei/yPSO5tl8+F09SR6p5DoBxrZ0I6UA== - dependencies: - "@lerna/command" "5.1.2" - "@lerna/filter-options" "5.1.2" - "@lerna/prompt" "5.1.2" - "@lerna/pulse-till-done" "5.1.2" - "@lerna/rimraf-dir" "5.1.2" +"@lerna/clean@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-5.1.4.tgz#293d3669aed70d541a5e16c372144ef0e5ea3bfd" + integrity sha512-4Du/r8iYSYFpo1t5J1BYivmj84n9mGebt89isVsyqMmrCqd5B2ix/Z8PYPQFMwm7k9YYbV+sZGSpRvtXkn8kIw== + dependencies: + "@lerna/command" "5.1.4" + "@lerna/filter-options" "5.1.4" + "@lerna/prompt" "5.1.4" + "@lerna/pulse-till-done" "5.1.4" + "@lerna/rimraf-dir" "5.1.4" p-map "^4.0.0" p-map-series "^2.1.0" p-waterfall "^2.1.1" -"@lerna/cli@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-5.1.2.tgz#6338515a6ff80f657e4c6e93da987d64c1c66bc5" - integrity sha512-Jmm4q/1UDf8PFao5uPemdTHvRWbsLps2zbvqXg+GffRKZsDEzyB9sQjf1Ul7BXN4/7kRsuQW/dBEXdH1D9EaAQ== +"@lerna/cli@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-5.1.4.tgz#8cf9ba07c8d0d072d5aa61e55d4d3a16ab181d79" + integrity sha512-ckLSNJBY4iVmu6nBhHb8UchpWGm49z9pjsAEJQ4F/VNkT6zKsmOCfv2ahkvudQ77gc0K/dH+MTvoOHsH85bpow== dependencies: - "@lerna/global-options" "5.1.1" + "@lerna/global-options" "5.1.4" dedent "^0.7.0" npmlog "^6.0.2" yargs "^16.2.0" -"@lerna/collect-uncommitted@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-5.1.2.tgz#3f0434714d400eb207577f7827e84db6ca5a694a" - integrity sha512-M4hyWRRppqU+99tRVz8eYHec2sVt5+CgKnrjf9AGARZZAX7I3oSX7JWCMSz73y6vIrq4moP4tZXvrJUqBpodkA== +"@lerna/collect-uncommitted@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-5.1.4.tgz#19ddf64bdb9a630ed4a651b364efeee32416e307" + integrity sha512-CI9PXYQuewqA4ZBMRycDUSVRJmAxUeP8HEZ3aKNvAwlLxLlGCueh8qOHXZHxgkmF6eQtcEjblsReiDt8bFJZpA== dependencies: - "@lerna/child-process" "5.1.1" + "@lerna/child-process" "5.1.4" chalk "^4.1.0" npmlog "^6.0.2" -"@lerna/collect-updates@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-5.1.2.tgz#0a9f7b5effa033dc60ef3d3ca72abb65542f3f99" - integrity sha512-UtwXYSm+x35G1JzixFIupJPMaCXVFPvSV1Kx+OKU42+ykWIyW4rb+/4OOqUNJfY9dxjjgUv1K275GKOl1W+VpQ== +"@lerna/collect-updates@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-5.1.4.tgz#c03aef26c6b28d55a693b47b60fa3f4bebbee6cf" + integrity sha512-P1zlaZ0QkKIjbU3o7hjd4zcxzti1ndS4+eQNmlxZP3IcmlJ4+Ne+VxGeaACsjzPPBqSBWX1xcyMFLALH/Jo2CA== dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/describe-ref" "5.1.2" + "@lerna/child-process" "5.1.4" + "@lerna/describe-ref" "5.1.4" minimatch "^3.0.4" npmlog "^6.0.2" slash "^3.0.0" -"@lerna/command@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-5.1.2.tgz#46358789014ed177a21735f8f5033ade42ad65a0" - integrity sha512-AsIAXo5zked/A12jgQTW3p25Uv1RpxsxArdTPGeBUqNgiIkKc413Dy+gYymfLhpcaWqzaTCr2CrinBYlbRVzlQ== - dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/package-graph" "5.1.2" - "@lerna/project" "5.1.2" - "@lerna/validation-error" "5.1.2" - "@lerna/write-log-file" "5.1.2" +"@lerna/command@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-5.1.4.tgz#c8f4b7f4700a6718310bea48e7ad2454e4659a80" + integrity sha512-S/3oIagN9/ntuGtljSxHu4liB9e9YFWsq/xZOR8YoqROJENv5G5zyAmHjXq90AR/tGmLvufzFliBfEIG9CywFA== + dependencies: + "@lerna/child-process" "5.1.4" + "@lerna/package-graph" "5.1.4" + "@lerna/project" "5.1.4" + "@lerna/validation-error" "5.1.4" + "@lerna/write-log-file" "5.1.4" clone-deep "^4.0.1" dedent "^0.7.0" execa "^5.0.0" is-ci "^2.0.0" npmlog "^6.0.2" -"@lerna/conventional-commits@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-5.1.2.tgz#ed7d0fee56666e5cfdd7e63ddd52d18253a1069d" - integrity sha512-lpgRRFnO+HCzABXGx0dJwXknAfgUJXILUBSmjjsp7SQVaPjBE5QCyenbt5YoAv+ZJwt0M2eyXym09n5yn4UGFg== +"@lerna/conventional-commits@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-5.1.4.tgz#9aa42c32fd7b306dfb4d838e18e02261635a496f" + integrity sha512-0v0exYOH9cJTNpKggqAw7vHVLlPjqO6Y20PUg44F3GOEjd54VIGDqu+MkVhflqvUftzZjmcUHDUGHVP+8dFBNw== dependencies: - "@lerna/validation-error" "5.1.2" + "@lerna/validation-error" "5.1.4" conventional-changelog-angular "^5.0.12" conventional-changelog-core "^4.2.2" conventional-recommended-bump "^6.1.0" @@ -2361,24 +2361,24 @@ pify "^5.0.0" semver "^7.3.4" -"@lerna/create-symlink@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-5.1.2.tgz#0bb7a68c129ff2ecd1ca54be96cf9fa06a0dcb82" - integrity sha512-79zXfJPflksp9lEiBETaSKZ8TO9Posso2l2T3ZCFNIrsuccJLtE1Hvz4p9RsG/Y4CuDg0M1fJEHXSOulfS0qRw== +"@lerna/create-symlink@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-5.1.4.tgz#dc5f45f4e5192850eea920982c2f4e1808b899c5" + integrity sha512-VTTuCgM5gXk0frAFxfVQqfX9QxXKz6TKpKsHcC39BAR3aiSUW8vqRImbLvaFtKpnEMW0HshDfuzp6rRkaiyWYw== dependencies: cmd-shim "^4.1.0" fs-extra "^9.1.0" npmlog "^6.0.2" -"@lerna/create@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-5.1.2.tgz#13d26405609a0511be1a5ced0be52c08a12f4b59" - integrity sha512-ArS7doT38H/4vageWjIGzRzqPZJaSJrtDV6eh9vHpwSLHueLIJSK2glwMSeGeqdknSyuEVQY1j2HJbnZ+0Sbvw== +"@lerna/create@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-5.1.4.tgz#2829ff28c5e2b7060ee9e260868a8bf70f9d603e" + integrity sha512-UPR5EnFg0WzXiRIKl+MGHH3hBB6s1xkLDJNLGzac5Ztry/ibLDhl47wYoYcToiQ3/y3/3751WLJErF+A52mCyw== dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/command" "5.1.2" - "@lerna/npm-conf" "5.1.1" - "@lerna/validation-error" "5.1.2" + "@lerna/child-process" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/npm-conf" "5.1.4" + "@lerna/validation-error" "5.1.4" dedent "^0.7.0" fs-extra "^9.1.0" globby "^11.0.2" @@ -2394,217 +2394,217 @@ whatwg-url "^8.4.0" yargs-parser "20.2.4" -"@lerna/describe-ref@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-5.1.2.tgz#5702e9cda4dc777d7ea045a988353d9ff71738e2" - integrity sha512-6wO30uxx6akIbx7CXjE13TWhnwK0ziZCXdR4nQSJSMXIZIW75jR/DwiPJ0hZ8bveBp0wiCJnDuHNIsvGAj6sYw== +"@lerna/describe-ref@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-5.1.4.tgz#352da8757946ca1529a2655688323c9838a8e1ad" + integrity sha512-ztLWLIyrHPxVhs8yfVpCDIw2st5c246KfoTqjEX8N6s8v0dLs3vfCKCM70ej6lBNkwqBXSilgHrd3AkGq3kq6Q== dependencies: - "@lerna/child-process" "5.1.1" + "@lerna/child-process" "5.1.4" npmlog "^6.0.2" -"@lerna/diff@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-5.1.2.tgz#b0d29461c4bc82d8cf3644843e3ae72ac032bae5" - integrity sha512-+GqXr+RVMkzyID6XV+S2/DS8nkfFavt6M9BL7FgGZOC/27JEuZV/0CJETqR3EwmlhVJtQOQgn0p0QZmuC6YY1g== +"@lerna/diff@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-5.1.4.tgz#43a3c39b84c3148a89dcee5a3b7434909c5e601a" + integrity sha512-o5chvMHcKQS4zkdGX7LCaMgNn0flrG9OEiGt8DCIzRUa6aWJAlE2oZyOj+VsiUxzaZJxm2oV+GkISQYRJPlPug== dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/command" "5.1.2" - "@lerna/validation-error" "5.1.2" + "@lerna/child-process" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/validation-error" "5.1.4" npmlog "^6.0.2" -"@lerna/exec@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-5.1.2.tgz#357763ed5ab1b715729505ce4de9f556949f4b33" - integrity sha512-iNh894U+ZWLSNNDLAw8OpCltZQKO9WRjIxs+jUQQucux8xr1edYIOHEHf8eA/ouQLrROhU3EbWEot4OJ3Iyqqg== - dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/command" "5.1.2" - "@lerna/filter-options" "5.1.2" - "@lerna/profiler" "5.1.2" - "@lerna/run-topologically" "5.1.2" - "@lerna/validation-error" "5.1.2" +"@lerna/exec@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-5.1.4.tgz#b1b35c65593429dcc822fcbc72153d3cf3adf0b9" + integrity sha512-6vn1UCxJZTTt90WlWItI05yj4xaNOShgIl5Yi9mx1Ex6nVS32mmTOqHI/+Cn4M+P0C4u1hFymd2aIEfWnmdUsA== + dependencies: + "@lerna/child-process" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/filter-options" "5.1.4" + "@lerna/profiler" "5.1.4" + "@lerna/run-topologically" "5.1.4" + "@lerna/validation-error" "5.1.4" p-map "^4.0.0" -"@lerna/filter-options@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-5.1.2.tgz#6e81a14e83d32f08bfe10b0822e4ab1abaf5e5d5" - integrity sha512-OhQBqoqABrtRtWnLzcvDysZPKPsTvW85pCnssI0wGlIPVn780LHoEpteSDixyfnxxcWMSY3jymMUOJbvoR607w== +"@lerna/filter-options@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-5.1.4.tgz#417d9770cece09385c533ea89dbf140c9f49ded8" + integrity sha512-a6hLVZOb7awjI9Tk5hx90BB6GZz59npBRQN0kSG6drV1H+vi+wU7ee6OZ5EMHQgnzdZ6OjZQRHlWCCTXyNdKgQ== dependencies: - "@lerna/collect-updates" "5.1.2" - "@lerna/filter-packages" "5.1.2" + "@lerna/collect-updates" "5.1.4" + "@lerna/filter-packages" "5.1.4" dedent "^0.7.0" npmlog "^6.0.2" -"@lerna/filter-packages@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-5.1.2.tgz#ec9b524aeac944b5a2fac0f539be531ec3ff0e00" - integrity sha512-wMTqy2hmB+IH0OiXT5P5+eJmFJsLa69sipNrMkX9PVLOcopxKx/4qkC6kaJy/hw9+EjTMi0033CkogTwucSEnA== +"@lerna/filter-packages@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-5.1.4.tgz#54cd19d6f1fcbd27f0fd78c6f0c56412ebd7f454" + integrity sha512-a+ThrgYyGrTfBZUMfi/WvcqX3Ce6JaMZjTYoNAmKpHYNZFRqdmgOT1fFLLF+/y62XGqCf0wo50xRYNg0hIAf3Q== dependencies: - "@lerna/validation-error" "5.1.2" + "@lerna/validation-error" "5.1.4" multimatch "^5.0.0" npmlog "^6.0.2" -"@lerna/get-npm-exec-opts@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-5.1.2.tgz#93f346e92dfb0aee80bb9723c3d0bbf6c078ef47" - integrity sha512-bzKhjjYX4KoLzWXjyWzHvEMuJ2E1PllOqjO03sVA+N+xAjniCCeMMla8HA6nEeUmJmZXKgUqJrL3W3qM9JDIrw== +"@lerna/get-npm-exec-opts@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-5.1.4.tgz#99a8f9ce73acac6206331b4cb87f24006e712cb4" + integrity sha512-A+cNgTWWQOcNGWz9wj40/NWK46v8TtTAmXuEPfzDruv6VdmXEVIuq7SCeUPj9+aRxMQXVCil0/Vyo2z6R9TDLw== dependencies: npmlog "^6.0.2" -"@lerna/get-packed@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-5.1.1.tgz#55c4c0baceca80ca5db78b4e980146079556c020" - integrity sha512-QWeOAoB5GGWnDkXtIcme8X1bHhkxOXw42UNp4h+wpXc8JzKiBdWcUVcLhKvS4fCmsRtq202UB6hPR+lYvCDz8w== +"@lerna/get-packed@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-5.1.4.tgz#cd376e017afb5327391ecdf781377c9b9fed09bb" + integrity sha512-JD9U4Sp7Dpt3nUdXAo5f9SIXK2QsBaguChCZ8VTAl3eb7j0o7nrHYoh1eAa8rDT2L9+AxcUFDMi/wDdCotlJmA== dependencies: fs-extra "^9.1.0" ssri "^8.0.1" tar "^6.1.0" -"@lerna/github-client@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-5.1.2.tgz#4bb396115c2b13f323ce8d88e2f3aad673162218" - integrity sha512-1Co6DXlJsqvBQR2lKURMFB6nS7wZ9Su++mzzPuB5KmUg0BRX9HVRVRxIHv/m5X8WX1OGxG2HDC0JD0sPNxOszQ== +"@lerna/github-client@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-5.1.4.tgz#818b921b12f2777dc55d1f4f955669c72fec7dcb" + integrity sha512-VAaH9ycnGVsaGWM5uRKvd0oXlOERHOEOwxXLaCnR1mA7k5490B5jTlwhSWYdA4s40CF9AOdIVNgBhP+T7MlcPw== dependencies: - "@lerna/child-process" "5.1.1" + "@lerna/child-process" "5.1.4" "@octokit/plugin-enterprise-rest" "^6.0.1" "@octokit/rest" "^18.1.0" git-url-parse "^11.4.4" npmlog "^6.0.2" -"@lerna/gitlab-client@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-5.1.2.tgz#e4b8254f4cd51215ee7bf81109afced71d2cfb18" - integrity sha512-4vXrw/4hfF4mytefe4L8dKXQQP9m3+9FZu4p4MnS4j8m1rtA2qs+CJ0Bxw6VJhBRTvz7mAWRi7EyACvuFqKtOw== +"@lerna/gitlab-client@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-5.1.4.tgz#82fb901eeaf75c51afa2c165e2bd26ef9695275c" + integrity sha512-F0Pa6Cv6TE0gbhuHR2gVVwdzstqePMZhTNcVY5So3YJrb1ppuUH/4cVXhRcEOj16QuWJ6yysxb7mj8tY4Zv0Bw== dependencies: node-fetch "^2.6.1" npmlog "^6.0.2" whatwg-url "^8.4.0" -"@lerna/global-options@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-5.1.1.tgz#0bddf25989c314c5f9c1639f64b306946f6692aa" - integrity sha512-jKLqwiS3EwNbmMu5HbWciModK6/5FyxeSwENVIqPLplWIkAMbSNWjXa9BxNDzvsSU0G6TPpQmfgZ3ZS1bMamyA== +"@lerna/global-options@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-5.1.4.tgz#6daa9572c76171cdeb4cd4e48a7a1beae3e2ab4f" + integrity sha512-gs6y97tomIuyYdDr9uKQ5B5AR9m6wVft6lrxWlGlLo0prz39tx7fJ9wT2IpJ9iALCadkQW6g7XFtddwfm5VRhg== -"@lerna/has-npm-version@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-5.1.1.tgz#361d0673817d44b961d68d6d4be8233b667ae82b" - integrity sha512-MkDhYbdNugXUE7bEY8j2DGE1RUg/SJR613b1HPUTdEWpPg13PupsTKqiKOzoURAzUWN6tZoOR7OAxbvR3w8jnw== +"@lerna/has-npm-version@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-5.1.4.tgz#4e2c01072ac4420e5ed3b645fa04d0673de38a25" + integrity sha512-U81b1nvqwF8PGyHib8/AWeGbaNipGdqXZsRO5g3ob9A5X57GXJ86cQVLejLi+znY4SmQcHladC4TotJkpNF1Ag== dependencies: - "@lerna/child-process" "5.1.1" + "@lerna/child-process" "5.1.4" semver "^7.3.4" -"@lerna/import@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-5.1.2.tgz#d34fb22999895218f6b3e5b12f2971648b863b6f" - integrity sha512-NqpOIJ9ZLHYzwNGAAytBFFARrP47OtR2/6L6Kt+AyT/cVGzhONkvgHqlJ2cHav+txKgzvvgkBr2+X+YcqICUvQ== - dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/command" "5.1.2" - "@lerna/prompt" "5.1.2" - "@lerna/pulse-till-done" "5.1.2" - "@lerna/validation-error" "5.1.2" +"@lerna/import@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-5.1.4.tgz#28f5521f0fd69d894bb97325fa8c950d8200de3d" + integrity sha512-Kswe1NKJDUDlO/gbkFcurzaYlaj/fXlapHTaih9LmQDiVPOE9GphD5qnABCV0c4CqeSnCzRujT5BUjjL5z7viA== + dependencies: + "@lerna/child-process" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/prompt" "5.1.4" + "@lerna/pulse-till-done" "5.1.4" + "@lerna/validation-error" "5.1.4" dedent "^0.7.0" fs-extra "^9.1.0" p-map-series "^2.1.0" -"@lerna/info@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/info/-/info-5.1.2.tgz#0f09a0c54a486f0f8558484f02b99e58c0b9c053" - integrity sha512-c4c2ROnGT6W829UKbimkbqbhg+v3nujlxe09EBxBjb4Igz0JWawk0qHZN5dyPsR8JbyXC3oNRJneqTqCMECSHg== +"@lerna/info@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/info/-/info-5.1.4.tgz#fe803801d4ae747c25f914f7d3562d05902ede7e" + integrity sha512-9OMdNtmDMKLwfX+aZk9nHLfksYXuU7IcIiVJ9dR7gYx1PoKjXvTpd/+hd7t/tmElM21kmPVxQBu02L3KmXw+hQ== dependencies: - "@lerna/command" "5.1.2" - "@lerna/output" "5.1.2" + "@lerna/command" "5.1.4" + "@lerna/output" "5.1.4" envinfo "^7.7.4" -"@lerna/init@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-5.1.2.tgz#ed05343dbabbedd1f8a10e8e151e7506b60c97c1" - integrity sha512-rqd13oG8UR9Uxz8dI52+ysE5BbgApAyaJcB6rD4JJVXpvKNmp0dK4tlpcEkBHObk2wcrKTt/dG8gm7u3Ik1k1A== +"@lerna/init@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-5.1.4.tgz#7f195046e010c566f22d7a81b4167c0df2b88ef9" + integrity sha512-OdI5iWYT1JcB6f5mjmCjgpkOrpDdSSDzmSi34kp/NP1FkbskDoMffVBTQiV8/h6zAg3jk1+aLQYLMuR5E6nIwA== dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/command" "5.1.2" + "@lerna/child-process" "5.1.4" + "@lerna/command" "5.1.4" fs-extra "^9.1.0" p-map "^4.0.0" write-json-file "^4.3.0" -"@lerna/link@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-5.1.2.tgz#557c8f7822057ce2615fcda1156e0012932cfcc0" - integrity sha512-t0H65K6SnImib22hn8he/f6ZPSfNXDfVFIaYqVa1oxyOhh+iBtz8ZX67YyhTCSoxYH+Ve6UWOcq8aoPcEyWXqQ== +"@lerna/link@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-5.1.4.tgz#5009da73e9f7d899bb5495e9ebb2f1ececb83f4b" + integrity sha512-j73MW+vam6e8XdwyQGeHR9X7TUmgvLG0wV1vDLjSyrhk/Q5oFo0RTRgfDJqR4tCtRnv0vujvw5oDXfSbBmg67g== dependencies: - "@lerna/command" "5.1.2" - "@lerna/package-graph" "5.1.2" - "@lerna/symlink-dependencies" "5.1.2" + "@lerna/command" "5.1.4" + "@lerna/package-graph" "5.1.4" + "@lerna/symlink-dependencies" "5.1.4" p-map "^4.0.0" slash "^3.0.0" -"@lerna/list@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-5.1.2.tgz#c4da143a42b491b392c00eb80b86f82aaaede966" - integrity sha512-0v6neIfwxfmgLj+5MVkwQ9eydVUelV3wU/1whrx37VxKdijgrkn8irJkhkkmSuqjpDWjb8X/1fDbe9RqgzS9fg== +"@lerna/list@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-5.1.4.tgz#19f8d229e3d39384e7f7ae4d67c7f3a3b8af751a" + integrity sha512-D7FAUik18s5FtHnBoPzodR8LUvH5b0a/ziV8ICaKWZ98H4w9qpNsQtBe0O+7DwUuqLKYpycst5tY5WVGnNwuNA== dependencies: - "@lerna/command" "5.1.2" - "@lerna/filter-options" "5.1.2" - "@lerna/listable" "5.1.2" - "@lerna/output" "5.1.2" + "@lerna/command" "5.1.4" + "@lerna/filter-options" "5.1.4" + "@lerna/listable" "5.1.4" + "@lerna/output" "5.1.4" -"@lerna/listable@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-5.1.2.tgz#d490757de2565a81456635db5cbd5aa5867a6279" - integrity sha512-2bOGTg4UXtBXmpel61qnNpUcni7ziNzIFsBTOg1Lx2xDD8iuzEN+uh+wYtnJFTV+0Mff6TN7oEoXAct0PvKt3g== +"@lerna/listable@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-5.1.4.tgz#0eb7d124502bfb3641959b6f86775e9ec9747e72" + integrity sha512-grGLrffBNX38l5mzZgkv4xE9UcAAKBi1s+LgloI3rusgTdE/B8gvCOYMqLf9V08iojs7Ke2xPf0whJmbEeK/qA== dependencies: - "@lerna/query-graph" "5.1.2" + "@lerna/query-graph" "5.1.4" chalk "^4.1.0" columnify "^1.6.0" -"@lerna/log-packed@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-5.1.2.tgz#e7191e5496fea01c13ed6c34c6ddc270d7f37ded" - integrity sha512-Uw4uQi7I/LOyoALs9JCvybpid7qwnFWfqY972V5VMO64bBiumzGumXbFhHmIsODfRHGiWpLMrAb+gEjk+Rw3Xg== +"@lerna/log-packed@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-5.1.4.tgz#23f64fe9e80157af6e1e848d06bdb9d786439269" + integrity sha512-qJlWMVjc/uM1I7AWqrOPeBLVZy9YExi/QqUyvmkb8mmsPXnW7rxIJQdYgRifS5aFNTbX/MtG8Q65Rr4syiVnSA== dependencies: byte-size "^7.0.0" columnify "^1.6.0" has-unicode "^2.0.1" npmlog "^6.0.2" -"@lerna/npm-conf@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-5.1.1.tgz#c4f013968f897dc854cc6dba429c99a516f26b5d" - integrity sha512-cHc26cTvXAFJj5Y6ScBYzVpJHbYxcIA0rE+bh8VfqR4UeJMll2BiFmCycIZYUnL7p27sVN05/eifkUTG6tAORg== +"@lerna/npm-conf@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-5.1.4.tgz#6d746452806397e941399e6bf13da62e5c41cb8f" + integrity sha512-kNbw2jO0HD9P4+nS8RIFub549BiQYG/sdFUuNWu7cCjErB+g/5ayfE6Mn5HyiRPMYXVw73iR8IzvkCCDWEOB7Q== dependencies: config-chain "^1.1.12" pify "^5.0.0" -"@lerna/npm-dist-tag@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-5.1.2.tgz#197c68e2706f2deb21aaddfdea3afc54d4a9fe48" - integrity sha512-UUF6NQRY6RIL9LZui2tviuylyOJfZrKv6C4hND3ylcoDl5kOyxEL8E4vj7OtKz3L5v0io8Vi9VFXUFpOe+IRtQ== +"@lerna/npm-dist-tag@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-5.1.4.tgz#32d6eb915134a5c26a62eea509b553aafb604b7b" + integrity sha512-9q5N3iy8KGFBsyRBmNEftj8ACeCXNh2JUBqk/wYGiB0WH0oVf0UY/uo6VUy8dZjyJ9Q0eZa1ONtFHIg3QrzGDA== dependencies: - "@lerna/otplease" "5.1.2" + "@lerna/otplease" "5.1.4" npm-package-arg "^8.1.0" npm-registry-fetch "^9.0.0" npmlog "^6.0.2" -"@lerna/npm-install@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-5.1.2.tgz#7bcae73e31501baf0836a00322fdcd6d542fd511" - integrity sha512-Nv6L7PpLB9HQtg2RqoiP4QqZQRHGbx326vll4rQEajtPP8zeZ7kLbeVqAEqJoOr9vdEHAfYXj6W7zEyWJoFU1A== +"@lerna/npm-install@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-5.1.4.tgz#5b85d0b097380ae089297cb9903508230df5dd49" + integrity sha512-DbbUK2Zy7ZBpkHimlFKf7XbGzBsoPfqzf0i9hIYBHmND9YWSgIgVFJcyRH7E6UKpr4wRChW4h6xEV81jKykB7w== dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/get-npm-exec-opts" "5.1.2" + "@lerna/child-process" "5.1.4" + "@lerna/get-npm-exec-opts" "5.1.4" fs-extra "^9.1.0" npm-package-arg "^8.1.0" npmlog "^6.0.2" signal-exit "^3.0.3" write-pkg "^4.0.0" -"@lerna/npm-publish@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-5.1.2.tgz#21a5779e25ed885d43efcef6519d22fc71f8bbe0" - integrity sha512-cag+gq+Wb3cZ8Pbz+zBQFilJu87U7kchiAFijDo223DSIqpATeAViQw3uCtPkhOAXKygaZupSqbXQTUu4Po8jA== +"@lerna/npm-publish@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-5.1.4.tgz#7f922a7e778b94106ba8929c30324554238faaab" + integrity sha512-MXtd2cFN+oJMxj9m1fXYAo+KE2BzO84Ukt3uAhQb1cXU01ZCwqGl/lQRWw5vI88emrKs0akx3d6E77PFpX9rpw== dependencies: - "@lerna/otplease" "5.1.2" - "@lerna/run-lifecycle" "5.1.2" + "@lerna/otplease" "5.1.4" + "@lerna/run-lifecycle" "5.1.4" fs-extra "^9.1.0" libnpmpublish "^4.0.0" npm-package-arg "^8.1.0" @@ -2612,85 +2612,85 @@ pify "^5.0.0" read-package-json "^3.0.0" -"@lerna/npm-run-script@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-5.1.2.tgz#8740d0fec08a556fd1f9c08e31888428dac16cea" - integrity sha512-vkfxixKP13Jk8no/XFud5pxF5NLqk/a3qc7iTbzceSltEbvM3rirPC09WH9DfcSDiIhF105Pr7/Xq1YAzNmpgw== +"@lerna/npm-run-script@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-5.1.4.tgz#6db6a15ff4a012d064b14c72601031b64c8137ec" + integrity sha512-vw2G69lFmFzdX553GidE66QgCZ3cGyxoOvnpCdvZ1n9AS5ZwZSiL8Ms6N3Vj+AOhESFZmFZkzIVhtpX5/xNzLg== dependencies: - "@lerna/child-process" "5.1.1" - "@lerna/get-npm-exec-opts" "5.1.2" + "@lerna/child-process" "5.1.4" + "@lerna/get-npm-exec-opts" "5.1.4" npmlog "^6.0.2" -"@lerna/otplease@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-5.1.2.tgz#1dec106abf65b44852d431544af390e93a105173" - integrity sha512-ZbJLAyQQawXydIyciqiYyp0KW5cyKjMj41nQH81lKjPQD4WFjwpELATe+sxFua90f0y9VxEwE6+4UwNYONgRYw== +"@lerna/otplease@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-5.1.4.tgz#211956a78fa9ff2bed94e3b2a32762b68dfbd15f" + integrity sha512-t3qKC55D7rCacNTsqQwn25XxDRQXgRHYWS0gqn2ch+dTwXOI61Uto9okVhgn2ZfZVydJ3sjnktOsPeSXhQRQew== dependencies: - "@lerna/prompt" "5.1.2" + "@lerna/prompt" "5.1.4" -"@lerna/output@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/output/-/output-5.1.2.tgz#c785bbc6337aea261f36e4287ca277d385647647" - integrity sha512-KT1pigGM4zp5o2iahsQVcpBv/XIDpVqc1dnscqITstrmbiq+qFI0+s6L73+eZwyu2rCalFinkj1pIEFF/Qr/iw== +"@lerna/output@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/output/-/output-5.1.4.tgz#6b56336b612a573994125a11a7b139deda2b5576" + integrity sha512-E9nLEcV5GJbTKJd/d+cvU54CIzQqoU2rJAeXeyHTufbjgCTPk4I8uDNHmG7uJ+aPrif6PPBt1IIw+w5UnStfdw== dependencies: npmlog "^6.0.2" -"@lerna/pack-directory@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-5.1.2.tgz#d647f7c84da04db5889cd66862ebcef942832a0c" - integrity sha512-w8XH/KrgxIQqw28bmQvtyF5og6d0Qj/2I2VnFwmQzxOpx+s8JgUF1dFxdxq+uuelkpPsRe5p2mg7IEEuaAeJ4w== +"@lerna/pack-directory@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-5.1.4.tgz#9a069e5bfc0d61391bd6c6f2ba362c8907cb80a7" + integrity sha512-TsltQrbwC/bPwQbL5i7WCMNM4Chl8+iqzawRZbILfjYpt3UK9xSV2tWfc9QtbmRBETvcFz/UMKQQDz+LMWN9jw== dependencies: - "@lerna/get-packed" "5.1.1" - "@lerna/package" "5.1.1" - "@lerna/run-lifecycle" "5.1.2" - "@lerna/temp-write" "5.1.0" + "@lerna/get-packed" "5.1.4" + "@lerna/package" "5.1.4" + "@lerna/run-lifecycle" "5.1.4" + "@lerna/temp-write" "5.1.4" npm-packlist "^2.1.4" npmlog "^6.0.2" tar "^6.1.0" -"@lerna/package-graph@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-5.1.2.tgz#eed5fa5bebf35d56e8a03eff0a0e3b5a448f4445" - integrity sha512-dp7pIBUt0NvbVxxxiQjW1xZzwTidFvxP2G2Xc9AnBp/O52KtiQK7Lw2v4U9mMd83Aq1CsJITvsaNssqFWihC7Q== +"@lerna/package-graph@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-5.1.4.tgz#df5910f588334284637a6a3cc24766806ba88f52" + integrity sha512-dP1gLcrqou5/8zef7u5ne4GTslNXULjpi3dDiljohKNR4XelsC4lkkF9m1Uzn9E1nAphHRhWXrRq40kqxmdYXg== dependencies: - "@lerna/prerelease-id-from-version" "5.1.1" - "@lerna/validation-error" "5.1.2" + "@lerna/prerelease-id-from-version" "5.1.4" + "@lerna/validation-error" "5.1.4" npm-package-arg "^8.1.0" npmlog "^6.0.2" semver "^7.3.4" -"@lerna/package@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-5.1.1.tgz#f775a59e1e8abe8cbf6bd70438a42926d311cebe" - integrity sha512-1Re5wMPux4kTzuCI4WSSXaN9zERdhFoU/hHOoyDYjAnNsWy8ee9qkLEEGl8p1IVW8YSJTDDHS0RA9rg35Vd8lA== +"@lerna/package@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-5.1.4.tgz#7dd77d18cd0227793afa9819be988167bcc0cb02" + integrity sha512-L0zsxslJZ+swkG/KLU3TQHmWPR0hf0eLIdOROyA9Nxvuo8C/702ddYZcuEYcz9t/jOuSgSB2s90iK2oTIncNbw== dependencies: load-json-file "^6.2.0" npm-package-arg "^8.1.0" write-pkg "^4.0.0" -"@lerna/prerelease-id-from-version@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-5.1.1.tgz#e5f57577cda44569af413958ba2bd420276e2b46" - integrity sha512-z4h1oP5PeuZV7+b4BSxm43DeUeE1DCZ7pPhTlHRAZRma2TBOfy2zzfEltWQZhOrrvkO67MR16W8x0xvwZV5odA== +"@lerna/prerelease-id-from-version@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-5.1.4.tgz#ea34adb5810622a656fa8dea17595d6b794e2872" + integrity sha512-kDcXKKFD6Ww/FinLEvsY1P3aIiuVLyonkttvfKJTJvm3ymz7/fBKz8GotFXuONVC1xSIK9Nrk3jGYs6ZGoha+w== dependencies: semver "^7.3.4" -"@lerna/profiler@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/profiler/-/profiler-5.1.2.tgz#d16634b4fd2cfd66f2e2f7a5f11c4a25b6b63292" - integrity sha512-JVZIc8e6yHBTlzU5d+zx9Tdrj7Bhuu78NLphuSWPx+XTVKYpi8U9e/4UejC3uEVd/Nu7twyM5kXkvPCCiT14Hg== +"@lerna/profiler@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/profiler/-/profiler-5.1.4.tgz#ce679f1a0b29489e3b530c6708c6f951d46fd15d" + integrity sha512-JLkS90+CSmi85v3SlJc5Wjk73MHmIviqtL3fM/Z6clBLbsRPkbBBfSwXKp7O281knF6E2UNTrWOtEG7b6wG3TQ== dependencies: fs-extra "^9.1.0" npmlog "^6.0.2" upath "^2.0.1" -"@lerna/project@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-5.1.2.tgz#cbc9b8a860af3d2830d5df5209c9687b998e1b4b" - integrity sha512-mUGqP7riSndDjYTE+u4uV7YgW2+4Ctu0mZ2MnScsmcJAquBqPOLmfo5f0aY4QXYF4JQyN2dfPa9OQUwKLcnSMA== +"@lerna/project@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-5.1.4.tgz#5185a6ef17d4cc2be0fec505e0f4507c2e68af3b" + integrity sha512-k0z3w45t746uAUkN+jY/jF+/BqHodGFYaUfM0DTDOGUWC8tXzxuqk3bchShp6Wct2gwNQWbtWHl50Jhhw5PC5g== dependencies: - "@lerna/package" "5.1.1" - "@lerna/validation-error" "5.1.2" + "@lerna/package" "5.1.4" + "@lerna/validation-error" "5.1.4" cosmiconfig "^7.0.0" dedent "^0.7.0" dot-prop "^6.0.1" @@ -2702,38 +2702,38 @@ resolve-from "^5.0.0" write-json-file "^4.3.0" -"@lerna/prompt@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-5.1.2.tgz#301a13da68b9787346cdefbda18f5c344d2b651f" - integrity sha512-3skvdE/XkiRrvpl/IbccQNn3/U/0tTPS5pt+O1pyrfXi1FSG9xV+PsqgeZ51ax2UxGtPAPRG2Vtp+fjfl6hUEA== +"@lerna/prompt@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-5.1.4.tgz#16f6f56752e0e542350cafbc8583d3d4690d8394" + integrity sha512-AiE8NIzh+x2+F0t96M+rfwLtKzBNXjQEWXtBfEcA1eRqanMWUr6ejfmdkoEzXVrMzyY/ugPdWQYbGCI00iF7Tg== dependencies: inquirer "^7.3.3" npmlog "^6.0.2" -"@lerna/publish@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-5.1.2.tgz#af6134523095c7477c8cd6bbd7697468bd50d28a" - integrity sha512-fXXXV81l104rt8vAInpO2TUo4DTnFq7+e/2tPTWIde5VI/xjuynrFgjUHBOpoRT6DsWKvG+wAdHrIrlUYqszkA== - dependencies: - "@lerna/check-working-tree" "5.1.2" - "@lerna/child-process" "5.1.1" - "@lerna/collect-updates" "5.1.2" - "@lerna/command" "5.1.2" - "@lerna/describe-ref" "5.1.2" - "@lerna/log-packed" "5.1.2" - "@lerna/npm-conf" "5.1.1" - "@lerna/npm-dist-tag" "5.1.2" - "@lerna/npm-publish" "5.1.2" - "@lerna/otplease" "5.1.2" - "@lerna/output" "5.1.2" - "@lerna/pack-directory" "5.1.2" - "@lerna/prerelease-id-from-version" "5.1.1" - "@lerna/prompt" "5.1.2" - "@lerna/pulse-till-done" "5.1.2" - "@lerna/run-lifecycle" "5.1.2" - "@lerna/run-topologically" "5.1.2" - "@lerna/validation-error" "5.1.2" - "@lerna/version" "5.1.2" +"@lerna/publish@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-5.1.4.tgz#d9d7203ec7e9dc3d0a9b8123a2c0b1afa536bd05" + integrity sha512-hbFAwOlyUR4AUBd7qTQXXVKgaxTS4Mz4Kkjxz8g7jtqo+T0KvU3JbfwDqxOiCwcDk+qkrBbkwbvc27jcObSwkw== + dependencies: + "@lerna/check-working-tree" "5.1.4" + "@lerna/child-process" "5.1.4" + "@lerna/collect-updates" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/describe-ref" "5.1.4" + "@lerna/log-packed" "5.1.4" + "@lerna/npm-conf" "5.1.4" + "@lerna/npm-dist-tag" "5.1.4" + "@lerna/npm-publish" "5.1.4" + "@lerna/otplease" "5.1.4" + "@lerna/output" "5.1.4" + "@lerna/pack-directory" "5.1.4" + "@lerna/prerelease-id-from-version" "5.1.4" + "@lerna/prompt" "5.1.4" + "@lerna/pulse-till-done" "5.1.4" + "@lerna/run-lifecycle" "5.1.4" + "@lerna/run-topologically" "5.1.4" + "@lerna/validation-error" "5.1.4" + "@lerna/version" "5.1.4" fs-extra "^9.1.0" libnpmaccess "^4.0.1" npm-package-arg "^8.1.0" @@ -2744,97 +2744,97 @@ pacote "^13.4.1" semver "^7.3.4" -"@lerna/pulse-till-done@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-5.1.2.tgz#240b84711524c6878073e872340d59f6aa66bef3" - integrity sha512-Xu7FAAchWKB6gl0/kHJ2bhqBFDR+8HnVOxFE0gyx7qPqHxtGCrQDmIYdVM3iRDvtRhMSU3pdqQhdFJNrVN3fCg== +"@lerna/pulse-till-done@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-5.1.4.tgz#b82b362341665e44e2885abd84b22e4122bafcaa" + integrity sha512-zFPzv6cY0OcqtcR91ueZqd+ulTLE4vPk9l6iPAfefgqh6w0E6hSmG6J9RmYE3gaMHSFJdvYHb/yyTPLF32J9lg== dependencies: npmlog "^6.0.2" -"@lerna/query-graph@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-5.1.2.tgz#b4a5176a4bb70f751fbf91bbd9d59dcb8d97a32f" - integrity sha512-eK8bROngdBe7kDFiIDzhG06WeMrpXpYaKxCo8DAanu8VzRCSfYE8GQyzxiU8Dmd7OjVE8bEOuABTsIWF9+cHqA== +"@lerna/query-graph@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-5.1.4.tgz#7333bebc711e03755fb96e23b4e99c974eac3d10" + integrity sha512-G8DYNqp5ISbbMjEJhGst1GHk59zO18IG9oaVSK14M7iF3qCLtg0iJ1Do4LDNpda3EF8PrLOx2mrNM5MBcGMjEg== dependencies: - "@lerna/package-graph" "5.1.2" + "@lerna/package-graph" "5.1.4" -"@lerna/resolve-symlink@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-5.1.2.tgz#4fb5379dcd36a98de1ca77531b869c16baede41e" - integrity sha512-03G+c+UgKBO7gBFcCjnsZdMY6+z6SeYKhpvEP//0y4mo9XI6e7yn5/rImYt7uFGy3u5CDEhzpBvfBoygmwiz0w== +"@lerna/resolve-symlink@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-5.1.4.tgz#7173d4103d1ae868a000336a636fcbfd15a8ae53" + integrity sha512-hpnaX5tznAtbQXlyc92kJiywdTnnbCf6wihSZwDiVnVgXuHJ3LvmjN677h9A0jobY6KdTT+wIoAHpJuZHj60vQ== dependencies: fs-extra "^9.1.0" npmlog "^6.0.2" read-cmd-shim "^2.0.0" -"@lerna/rimraf-dir@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-5.1.2.tgz#7ca04a5d108e261031cc4c6dec68ab21f12900a9" - integrity sha512-6FevNdvV/F7/yVL+DpQ12EPE1iJwwpYDsMSjRT7eIno44tdkoZyK+GeflqyPgCf7vkb4budJSWK+as17yNfYig== +"@lerna/rimraf-dir@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-5.1.4.tgz#2d216d97d223aa7a521ae77cae1ae29a6a0d96ca" + integrity sha512-WvHm4gE1/HWbI4gCjJw3clPT+FRq2Ob9I9EDbfw4c307MNT4kW4bJU2mt0nyv/uwYhUkTG+GQVrlt+Dtcif77g== dependencies: - "@lerna/child-process" "5.1.1" + "@lerna/child-process" "5.1.4" npmlog "^6.0.2" path-exists "^4.0.0" rimraf "^3.0.2" -"@lerna/run-lifecycle@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-5.1.2.tgz#edd9fd0971353dfaffa6005c566e8868ae71079a" - integrity sha512-gqZtR7iCYOt6tnzXDHhtXuE5MnL/ewvBRbydC3jFPHL2TJnEaGky1YTPuUqiRBTo53F0YHVWmCFWm5WUik1irA== +"@lerna/run-lifecycle@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-5.1.4.tgz#9d0e80bec6dee25342640b7ccfbe13d89d22e32d" + integrity sha512-ubmqi1ixebBHSTYS0oK8MoqBoJE7UDrXWTWsv84UrXiPutTffLR8ZQJKlMEcetQVzX9qbjpKbzc+jQWXPWid2A== dependencies: - "@lerna/npm-conf" "5.1.1" + "@lerna/npm-conf" "5.1.4" "@npmcli/run-script" "^3.0.2" npmlog "^6.0.2" -"@lerna/run-topologically@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-5.1.2.tgz#43b4c66f08fe75e5087a29d3627751aba6ef744f" - integrity sha512-spGKUDB9CQbrrCr2N59dAtIxQ39k/QLwAacR7o6WqQJSsrCg7d3k6GY9lvWrhQBKH+Iv3Vfhmp1bzb9YP0pTDQ== +"@lerna/run-topologically@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-5.1.4.tgz#f026407253e751102f2dba9ee764daa4b3a88bcf" + integrity sha512-MckWfLu/xuRtaThdUgrJC2naumv2LOIiMoJfxCdYpiCrIgq5YrwqOxjQ0awHqQhkvFZ5G91ucBcBEIMsOou1iw== dependencies: - "@lerna/query-graph" "5.1.2" + "@lerna/query-graph" "5.1.4" p-queue "^6.6.2" -"@lerna/run@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-5.1.2.tgz#700e54c197003bbe568500cc6f162edaa45c3955" - integrity sha512-qdp5vYtvTqv5sLb6gKUNmwPDENMEG5hCftoqshtP0PG2AoxrW9lYEiawtuWkvxmeod/W2Qjsk5aJppMvjSlqcg== - dependencies: - "@lerna/command" "5.1.2" - "@lerna/filter-options" "5.1.2" - "@lerna/npm-run-script" "5.1.2" - "@lerna/output" "5.1.2" - "@lerna/profiler" "5.1.2" - "@lerna/run-topologically" "5.1.2" - "@lerna/timer" "5.1.1" - "@lerna/validation-error" "5.1.2" +"@lerna/run@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-5.1.4.tgz#fb97a659eee440f978231306a0d8745a9a6eb39f" + integrity sha512-iaTioOF66z02Y9ml/Ba0ePpXOwZ+BkODcNXrJbyW8WhraL0fSjyno0FspO1Eu0nG4JMtgCsoEzHNphsk7Wg+7A== + dependencies: + "@lerna/command" "5.1.4" + "@lerna/filter-options" "5.1.4" + "@lerna/npm-run-script" "5.1.4" + "@lerna/output" "5.1.4" + "@lerna/profiler" "5.1.4" + "@lerna/run-topologically" "5.1.4" + "@lerna/timer" "5.1.4" + "@lerna/validation-error" "5.1.4" p-map "^4.0.0" -"@lerna/symlink-binary@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-5.1.2.tgz#8e9de3c2700945580c86c969e16b62de3a61acf9" - integrity sha512-QQvABdGdzcuHnCTkK/5CeWFqYhYPHRWWTrmxDBmx1OU3fXox5kN5dWegqmU7kASFWzgAuxmy/q3uUxFVWSM3bA== +"@lerna/symlink-binary@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-5.1.4.tgz#1bba4aa23125c8a8ce3d6b15b869caa62824c6b5" + integrity sha512-SNjHxCNTCD0Xfj3CNBTG+3ut4aDAVaq+SrB2ckFNmZ5Z9yFdnX6aP+PBzLD/0q5hj18lGlaJ8iZjD/ubbrgFCA== dependencies: - "@lerna/create-symlink" "5.1.2" - "@lerna/package" "5.1.1" + "@lerna/create-symlink" "5.1.4" + "@lerna/package" "5.1.4" fs-extra "^9.1.0" p-map "^4.0.0" -"@lerna/symlink-dependencies@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-5.1.2.tgz#a7713b2ec47b67307234edc429d41e22ea01a3df" - integrity sha512-Ul2fX3AWaEc0juHujG31d/yicFsJboRaW4r9yqNiTn6Vm2u8UUMaXmv6b8+i3MGY+tzd05gARpQAIUjBtxAOOA== +"@lerna/symlink-dependencies@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-5.1.4.tgz#70497b85cde43e9add4eacb10f1de35b97f937b9" + integrity sha512-SuzylyNs1R5bVRqSCwfbQLdDP83RX8ncQxOy2SSSrScwkzdBCDqDPh4haeADsq2+RoOQBItn1PDfzUCNAWomDA== dependencies: - "@lerna/create-symlink" "5.1.2" - "@lerna/resolve-symlink" "5.1.2" - "@lerna/symlink-binary" "5.1.2" + "@lerna/create-symlink" "5.1.4" + "@lerna/resolve-symlink" "5.1.4" + "@lerna/symlink-binary" "5.1.4" fs-extra "^9.1.0" p-map "^4.0.0" p-map-series "^2.1.0" -"@lerna/temp-write@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@lerna/temp-write/-/temp-write-5.1.0.tgz#3bcecf96fca04b3d91faa01ba89540c8f1a53031" - integrity sha512-IvtYcrnWISEe9nBjhvq+o1mfn85Kup6rd+/PHb3jFmxx7E6ON4BnuqGPOOjmEjboMIRaopWQrkuCoIVotP+sDw== +"@lerna/temp-write@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/temp-write/-/temp-write-5.1.4.tgz#eca417418496fbb29d8bae36b548fd7afb46523f" + integrity sha512-f+6+ud87pyitM9zAq7GBhB7uoHTcgLJvR3YGv5sNja4jIl3+zdKPDcyxzVyQb38knuRSkGM8NjYOWi4zwcMaGw== dependencies: graceful-fs "^4.1.15" is-stream "^2.0.0" @@ -2842,37 +2842,37 @@ temp-dir "^1.0.0" uuid "^8.3.2" -"@lerna/timer@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-5.1.1.tgz#4cd47757c5f254c2f34aac09d9cee0bccdbe91ea" - integrity sha512-c+v2xoxVpKcgjJEtiEw/J3lrBCsVxhQL9lrE1+emoV/GcxOxk6rWQKIJ6WQOhuaR/BsoHBEKF8C+xRlX/qt29g== +"@lerna/timer@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-5.1.4.tgz#a94734ba5bed1f3ad9b6fc0ce9609e5e624bc7ec" + integrity sha512-fhQtqkLxNexPWzhI1WAxZnHIBM8VhChvUJu503u1Rmp2JxhXbTE4Txnu1gPvqlDjdoE6ck0vN5icmfMVRwKc8g== -"@lerna/validation-error@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-5.1.2.tgz#b0f957cfd417a84adb05fc2fc400bd731e927227" - integrity sha512-aQrH0653tJeu2ZRVvLxK6l5Vz6Kc+hUGiLi7NOHr96fFyyKtAfheRdBjNz4XcW7Us0v/+B22GBwJgdWE1xtICQ== +"@lerna/validation-error@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-5.1.4.tgz#095d12367ec17a5fc00c0cf6cd8a83c3ddb9a9c3" + integrity sha512-wys9Fv/bUy7sYXOK9t+V3XSyEHK5tUXwY22nfIDYu416WcSkkE4DI8Q2nTv4nYYOmG2Y7IOhaSenbsPLQ0VqtQ== dependencies: npmlog "^6.0.2" -"@lerna/version@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-5.1.2.tgz#594b75db7f46fda797bafd64cae52e7faa1c5c10" - integrity sha512-xwacrH9wpom2up8BrHOBze9Hb6OuWZtv9Z4m5+4KaOM9KcwtGjIDEjKs+YQlDqsnepYxkTRdKUTnoNI5F7thXw== - dependencies: - "@lerna/check-working-tree" "5.1.2" - "@lerna/child-process" "5.1.1" - "@lerna/collect-updates" "5.1.2" - "@lerna/command" "5.1.2" - "@lerna/conventional-commits" "5.1.2" - "@lerna/github-client" "5.1.2" - "@lerna/gitlab-client" "5.1.2" - "@lerna/output" "5.1.2" - "@lerna/prerelease-id-from-version" "5.1.1" - "@lerna/prompt" "5.1.2" - "@lerna/run-lifecycle" "5.1.2" - "@lerna/run-topologically" "5.1.2" - "@lerna/temp-write" "5.1.0" - "@lerna/validation-error" "5.1.2" +"@lerna/version@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-5.1.4.tgz#87a2c19ba0d1e8c8417d6c2b87d1702e95a0bdf5" + integrity sha512-cYgm1SNdiK129JoWI8WMwjsxaIyeAC1gCaToWk36Tw+BCF3PbkdoTKdneDmJ+7qbX1QrzxsgHTcjwIt4lZPEqQ== + dependencies: + "@lerna/check-working-tree" "5.1.4" + "@lerna/child-process" "5.1.4" + "@lerna/collect-updates" "5.1.4" + "@lerna/command" "5.1.4" + "@lerna/conventional-commits" "5.1.4" + "@lerna/github-client" "5.1.4" + "@lerna/gitlab-client" "5.1.4" + "@lerna/output" "5.1.4" + "@lerna/prerelease-id-from-version" "5.1.4" + "@lerna/prompt" "5.1.4" + "@lerna/run-lifecycle" "5.1.4" + "@lerna/run-topologically" "5.1.4" + "@lerna/temp-write" "5.1.4" + "@lerna/validation-error" "5.1.4" chalk "^4.1.0" dedent "^0.7.0" load-json-file "^6.2.0" @@ -2886,10 +2886,10 @@ slash "^3.0.0" write-json-file "^4.3.0" -"@lerna/write-log-file@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-5.1.2.tgz#d7b1283ebd7833d807aed04e3a837f2008db7354" - integrity sha512-9u1KN8z5R48EQOgr7sAilu5Fqc4mYysTFTNCchCurzkKMAotMSSgLwRwVTPxH8MTFQpdo/xnrcvmIixMK4SSSg== +"@lerna/write-log-file@5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-5.1.4.tgz#bd9cc578d0a35be11f0c489252e945478a0d3c0d" + integrity sha512-ISJbkjaSKhJ4d7V90RFvuwDQFq9ZH/KN475KFJr+TBFZTwMiXuBahlq+j8/a+nItejNnuPD4/xlWuzCOuGJORQ== dependencies: npmlog "^6.0.2" write-file-atomic "^3.0.3" @@ -2929,26 +2929,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.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.18.0.tgz#23bfe8fee6534e086ddaff4daa5b9e2d27192e09" - integrity sha512-Q7ZhD6zKQd/J5ayNNChFCCgHZ8tw3ibljm6nXP/JEmiEFFbpKKtWMPVCaN8Y+8/qFmrz7mblLrupcKmUu8cF4A== +"@microsoft/api-extractor-model@7.18.2": + version "7.18.2" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.18.2.tgz#def74be8bc785beb9a6f52a0a4c0b9f8f782e587" + integrity sha512-m7MCvJrudnWyE4iuRhdmgJTdTkYLw+yN/XUp3y9sxicu5/mNdg8y4pflaM82ZbLakhfGreMlB/XgjvyGbLHwkA== dependencies: "@microsoft/tsdoc" "0.14.1" "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.45.5" + "@rushstack/node-core-library" "3.45.7" "@microsoft/api-extractor@^7.23.2": - version "7.25.0" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.25.0.tgz#a06bfe24abc7e4a82c586953b26debe94e852cd4" - integrity sha512-GS1XOY2RgLthUkfcTR4CLPvCIvpFYj+2MfJMZ3J4NX8H64BWSHGaDUvVV6QvjKNpt/RHdLyyJZ+j7dQveBAZnA== + version "7.25.2" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.25.2.tgz#365639ad7409dcc1ccdfdd9ba35db99592a41531" + integrity sha512-ITuiZqMszZE38dGqavkFFIAW/GQGfkk8ahgBqVj3j1qD4wioPTRlSidhQDCezExAhrMt/bTkuZ3woLeR0uiSsg== dependencies: - "@microsoft/api-extractor-model" "7.18.0" + "@microsoft/api-extractor-model" "7.18.2" "@microsoft/tsdoc" "0.14.1" "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.45.5" - "@rushstack/rig-package" "0.3.11" - "@rushstack/ts-command-line" "4.11.0" + "@rushstack/node-core-library" "3.45.7" + "@rushstack/rig-package" "0.3.12" + "@rushstack/ts-command-line" "4.11.1" colors "~1.2.1" lodash "~4.17.15" resolve "~1.17.0" @@ -3416,10 +3416,10 @@ estree-walker "^2.0.1" picomatch "^2.2.2" -"@rushstack/node-core-library@3.45.5": - version "3.45.5" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.45.5.tgz#00f92143cc21c3ad94fcd81ba168a40ac8cb77f2" - integrity sha512-KbN7Hp9vH3bD3YJfv6RnVtzzTAwGYIBl7y2HQLY4WEQqRbvE3LgI78W9l9X+cTAXCX//p0EeoiUYNTFdqJrMZg== +"@rushstack/node-core-library@3.45.7": + version "3.45.7" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.45.7.tgz#e959820a6db067c278c20df51503e2bc422e9349" + integrity sha512-DHfOvgPrm9X4uILlUfGgiqcobe5QGNDmqqYLM8dJ5M5fqQ9H5GwyUwBnFeRsxBo0b75RE83l41Oze+gdHKvKaA== dependencies: "@types/node" "12.20.24" colors "~1.2.1" @@ -3431,18 +3431,18 @@ timsort "~0.3.0" z-schema "~5.0.2" -"@rushstack/rig-package@0.3.11": - version "0.3.11" - resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.11.tgz#92a05929822610e8b42f2ad330d9ea20afae5165" - integrity sha512-uI1/g5oQPtyrT9nStoyX/xgZSLa2b+srRFaDk3r1eqC7zA5th4/bvTGl2QfV3C9NcP+coSqmk5mFJkUfH6i3Lw== +"@rushstack/rig-package@0.3.12": + version "0.3.12" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.12.tgz#6bf2d45374ba665902bf31ec0c6e5dad55ba1b73" + integrity sha512-ZzxuBWG0wbOtI+9IHYvOsr3QN52GtxTWpcaHMsQ/PC9us2ve/k0xK0XOMu+CtStyHSnBG2nDdnF9vFv9HMYOZg== dependencies: resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/ts-command-line@4.11.0": - version "4.11.0" - resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.11.0.tgz#4cd3b9f59b41aed600042936260fdaa55ca0184d" - integrity sha512-ptG9L0mjvJ5QtK11GsAFY+jGfsnqHDS6CY6Yw1xT7a9bhjfNYnf6UPwjV+pF6UgiucfNcMDNW9lkDLxvZKKxMg== +"@rushstack/ts-command-line@4.11.1": + version "4.11.1" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.11.1.tgz#10b80960ddaed685445289807c75743e4ef0b5e9" + integrity sha512-Xo8LaQOXlNSfp+qIuIPb1tfX7b4H21ksqiMo/HbeZI5AX1klHMqKjWcEs0AqgE9huvQj6cvnCla8Eq/GDcwMIg== dependencies: "@types/argparse" "1.0.38" argparse "~1.0.9" @@ -3958,19 +3958,19 @@ "@types/istanbul-lib-report" "*" "@types/jest-specific-snapshot@^0.5.5": - version "0.5.5" - resolved "https://registry.yarnpkg.com/@types/jest-specific-snapshot/-/jest-specific-snapshot-0.5.5.tgz#47ce738870be99898ed6d7b08dbf0240c74ae553" - integrity sha512-AaPPw2tE8ewfjD6qGLkEd4DOfM6pPOK7ob/RSOe1Z8Oo70r9Jgo0SlWyfxslPAOvLfQukQtiVPm6DcnjSoZU5A== + version "0.5.6" + resolved "https://registry.yarnpkg.com/@types/jest-specific-snapshot/-/jest-specific-snapshot-0.5.6.tgz#ce47102408981649a6fb1a57ee8062adb5591eac" + integrity sha512-AQdUbEyTwO6JR2yZK7PTXDzK32AlkviDZJZEukZnrZtBjITYBtExFh59HTNTZeFSs+k1b1bqCHmWUwj3VHeh/A== dependencies: "@types/jest" "*" "@types/jest@*", "@types/jest@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.1.tgz#8c9ba63702a11f8c386ee211280e8b68cb093cd1" - integrity sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA== + version "28.1.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.2.tgz#c678569bb2d8e5474dd88f0851613611aeed9809" + integrity sha512-5dNM7mMuIrCtNJsFfvUO/5xCrG8swuT2c7ND+sl3XwlwxJf3k7e7o+PRvcFN/iIm8XhCqHqxLOj9yutDDOJoRg== dependencies: - jest-matcher-utils "^27.0.0" - pretty-format "^27.0.0" + jest-matcher-utils "^28.0.0" + pretty-format "^28.0.0" "@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" @@ -4141,9 +4141,9 @@ integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== "@types/semver@*", "@types/semver@^7.3.9": - version "7.3.9" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" - integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== + version "7.3.10" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73" + integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw== "@types/serve-index@^1.9.1": version "1.9.1" @@ -6908,9 +6908,9 @@ eslint-plugin-eslint-comments@^3.2.0: ignore "^5.0.5" eslint-plugin-eslint-plugin@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-4.2.0.tgz#64c5ba82f9b1073c89a79a1c8f451f278be6603a" - integrity sha512-ZDyUUlZJw85hmc9pGciNFiQwojXKxV7KAAVnQtojk1W/I8YYHxYV9JBuzhfAYfVemiQzDPNwj1zwAqQwGN1ROw== + version "4.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-4.3.0.tgz#ff83102e3c7f6b3a85d61f8021a6a5f06189f153" + integrity sha512-0xZ++ilIpGY+gBwsaW/uIhG/Rrl/sltPCai3UUPzWbaOPud2tel9UCWj8sLTADNmVqBD+vcqLHzHY86q/b71yg== dependencies: eslint-utils "^3.0.0" estraverse "^5.2.0" @@ -6960,9 +6960,9 @@ eslint-plugin-jsx-a11y@^6.5.1: minimatch "^3.0.4" eslint-plugin-react-hooks@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.5.0.tgz#5f762dfedf8b2cf431c689f533c9d3fa5dcf25ad" - integrity sha512-8k1gRt7D7h03kd+SAAlzXkQwWK22BnK6GKZG+FJA6BAGy22CFvl8kCIXKpVux0cCxMWDQUPqSok0LKaZ0aOcCw== + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" + integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== eslint-plugin-react@^7.29.4: version "7.30.0" @@ -9172,7 +9172,7 @@ jest-leak-detector@^28.1.1: jest-get-type "^28.0.2" pretty-format "^28.1.1" -jest-matcher-utils@^27.0.0, jest-matcher-utils@^28, jest-matcher-utils@^28.1.1: +jest-matcher-utils@^28, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz#a7c4653c2b782ec96796eb3088060720f1e29304" integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== @@ -9625,27 +9625,27 @@ lazy-ass@^1.6.0: resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha1-eZllXoZGwX8In90YfRUNMyTVRRM= -lerna@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-5.1.2.tgz#294b0515f17cea160c37411e35b1de3f93965656" - integrity sha512-ZtcH7W7jttIHg2AgfauJ8u+wCE9xiHY6iwVrH8mIkbDxMrNW4J/J/fbfeyZRrbxHY6ThM9e4/Wpd3o/b2vKzcg== - dependencies: - "@lerna/add" "5.1.2" - "@lerna/bootstrap" "5.1.2" - "@lerna/changed" "5.1.2" - "@lerna/clean" "5.1.2" - "@lerna/cli" "5.1.2" - "@lerna/create" "5.1.2" - "@lerna/diff" "5.1.2" - "@lerna/exec" "5.1.2" - "@lerna/import" "5.1.2" - "@lerna/info" "5.1.2" - "@lerna/init" "5.1.2" - "@lerna/link" "5.1.2" - "@lerna/list" "5.1.2" - "@lerna/publish" "5.1.2" - "@lerna/run" "5.1.2" - "@lerna/version" "5.1.2" +lerna@5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-5.1.4.tgz#57b1cd1fc0078f3c5009a07a7f7a4f8b85929b70" + integrity sha512-WwSbMslPxWSV7ARsGzkhJAFC1uQcuNGgiy2vZho4bpXVC+A7ZLXy8FngDbcAn7hCGC3ZDnl/4jdY6d84j63Y4g== + dependencies: + "@lerna/add" "5.1.4" + "@lerna/bootstrap" "5.1.4" + "@lerna/changed" "5.1.4" + "@lerna/clean" "5.1.4" + "@lerna/cli" "5.1.4" + "@lerna/create" "5.1.4" + "@lerna/diff" "5.1.4" + "@lerna/exec" "5.1.4" + "@lerna/import" "5.1.4" + "@lerna/info" "5.1.4" + "@lerna/init" "5.1.4" + "@lerna/link" "5.1.4" + "@lerna/list" "5.1.4" + "@lerna/publish" "5.1.4" + "@lerna/run" "5.1.4" + "@lerna/version" "5.1.4" import-local "^3.0.2" npmlog "^6.0.2" @@ -9701,9 +9701,9 @@ linkify-it@^3.0.1: uc.micro "^1.0.1" lint-staged@^13.0.0: - version "13.0.1" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.0.1.tgz#899e78065ab29b88fdd922482411121664ef66be" - integrity sha512-Ykaf4QTi0a02BF7cnq7JIPGOJxH4TkNMWhSlJdH9wOekd0X+gog47Jfh/0L31DqZe5AiydLGC7LkPqpaNm+Kvg== + version "13.0.2" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.0.2.tgz#35a1c57130e9ad5b1dea784972a40777ba433dd5" + integrity sha512-qQLfLTh9z34eMzfEHENC+QBskZfxjomrf+snF3xJ4BzilORbD989NLqQ00ughsF/A+PT41e87+WsMFabf9++pQ== dependencies: cli-truncate "^3.1.0" colorette "^2.0.17" @@ -11709,7 +11709,7 @@ pretty-error@^4.0.0: lodash "^4.17.20" renderkid "^3.0.0" -pretty-format@*, pretty-format@^27.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1: +pretty-format@*, pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1: version "28.1.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.0.tgz#8f5836c6a0dfdb834730577ec18029052191af55" integrity sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q== @@ -11995,12 +11995,12 @@ react-dev-utils@^12.0.1: text-table "^0.2.0" react-dom@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.1.0.tgz#7f6dd84b706408adde05e1df575b3a024d7e8a2f" - integrity sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w== + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== dependencies: loose-envify "^1.1.0" - scheduler "^0.22.0" + scheduler "^0.23.0" react-error-overlay@^6.0.11: version "6.0.11" @@ -12590,9 +12590,9 @@ rollup-plugin-terser@^7.0.2: terser "^5.0.0" rollup@^2.75.4: - version "2.75.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.75.6.tgz#ac4dc8600f95942a0180f61c7c9d6200e374b439" - integrity sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA== + version "2.75.7" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.75.7.tgz#221ff11887ae271e37dcc649ba32ce1590aaa0b9" + integrity sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ== optionalDependencies: fsevents "~2.3.2" @@ -12672,10 +12672,10 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -scheduler@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.22.0.tgz#83a5d63594edf074add9a7198b1bae76c3db01b8" - integrity sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ== +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== dependencies: loose-envify "^1.1.0"