From 75dcf6942286f6ad3b507e469d160dc526cc7274 Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 12 Jul 2021 17:01:39 +0000 Subject: [PATCH 01/27] chore: publish v4.28.3 --- CHANGELOG.md | 8 ++++++++ lerna.json | 2 +- packages/ast-spec/CHANGELOG.md | 8 ++++++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-internal/package.json | 4 ++-- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin/package.json | 6 +++--- packages/experimental-utils/CHANGELOG.md | 8 ++++++++ packages/experimental-utils/package.json | 8 ++++---- packages/parser/CHANGELOG.md | 8 ++++++++ packages/parser/package.json | 10 +++++----- packages/scope-manager/CHANGELOG.md | 8 ++++++++ packages/scope-manager/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 8 ++++++++ packages/shared-fixtures/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 8 ++++++++ packages/typescript-estree/package.json | 8 ++++---- packages/visitor-keys/CHANGELOG.md | 8 ++++++++ packages/visitor-keys/package.json | 4 ++-- 24 files changed, 127 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca21552051d..5a6756dd203 100644 --- a/CHANGELOG.md +++ b/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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/typescript-eslint + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/typescript-eslint diff --git a/lerna.json b/lerna.json index 8d9a6d4a56c..f9690434936 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "4.28.2", + "version": "4.28.3", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 712ca8b88bb..ead1056ce9f 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 b79774de8c2..e5f525916ed 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "4.28.2", + "version": "4.28.3", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 37ba65ed95d..b31107fa227 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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 ebcf1ccf355..c32aabf3bee 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": "4.28.2", + "version": "4.28.3", "private": true, "main": "dist/index.js", "scripts": { @@ -14,7 +14,7 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "4.28.2", + "@typescript-eslint/experimental-utils": "4.28.3", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 0abafac6646..f0b94a6d9b7 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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 c0db8e0d519..9797a1a925e 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": "4.28.2", + "version": "4.28.3", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.2", + "@typescript-eslint/experimental-utils": "4.28.3", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "4.28.2" + "@typescript-eslint/parser": "4.28.3" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 45f204fda6e..e02ff4b4c9d 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/eslint-plugin diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 49a830f6e63..b757ab04647 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "4.28.2", + "version": "4.28.3", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,8 +44,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.2", - "@typescript-eslint/scope-manager": "4.28.2", + "@typescript-eslint/experimental-utils": "4.28.3", + "@typescript-eslint/scope-manager": "4.28.3", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 69478862a6e..b7c0740a4b8 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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 2b4159e79cb..27e3a328268 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "4.28.2", + "version": "4.28.3", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.28.2", - "@typescript-eslint/types": "4.28.2", - "@typescript-eslint/typescript-estree": "4.28.2", + "@typescript-eslint/scope-manager": "4.28.3", + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/typescript-estree": "4.28.3", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 8f90d0eea4f..cb6b0ffca4a 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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index fbbc52a5a3b..f401713d641 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "4.28.2", + "version": "4.28.3", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,14 +44,14 @@ "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "4.28.2", - "@typescript-eslint/types": "4.28.2", - "@typescript-eslint/typescript-estree": "4.28.2", + "@typescript-eslint/scope-manager": "4.28.3", + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/typescript-estree": "4.28.3", "debug": "^4.3.1" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/experimental-utils": "4.28.2", + "@typescript-eslint/experimental-utils": "4.28.3", "glob": "*", "typescript": "*" }, diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index d3e8233f378..ac73210cd4c 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 378a3b0eff1..86416b0f357 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "4.28.2", + "version": "4.28.3", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.28.2", - "@typescript-eslint/visitor-keys": "4.28.2" + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/visitor-keys": "4.28.3" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "4.28.2", + "@typescript-eslint/typescript-estree": "4.28.3", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 7f79cbd4f6a..1041ae190cd 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 20b2388f914..abd3edbb3fa 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "4.28.2", + "version": "4.28.3", "private": true } diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index cac3b56d479..0054ec2bff0 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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 65a45a68698..486965fa423 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "4.28.2", + "version": "4.28.3", "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 0e89e920425..31e48ba5166 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 099895a2e65..96e861c9c55 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "4.28.2", + "version": "4.28.3", "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": "4.28.2", - "@typescript-eslint/visitor-keys": "4.28.2", + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/visitor-keys": "4.28.3", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "4.28.2", + "@typescript-eslint/shared-fixtures": "4.28.3", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 76b8e248dfc..9bcd665dcb4 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. +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **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 8fcb569536c..8e4ad403c5e 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "4.28.2", + "version": "4.28.3", "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": "4.28.2", + "@typescript-eslint/types": "4.28.3", "eslint-visitor-keys": "^2.0.0" }, "devDependencies": { From 84fff3575282f09683385e855c20df3c261ce313 Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 19 Jul 2021 17:04:09 +0000 Subject: [PATCH 02/27] chore: publish v4.28.4 --- CHANGELOG.md | 8 ++++++++ lerna.json | 2 +- packages/ast-spec/CHANGELOG.md | 8 ++++++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-internal/package.json | 4 ++-- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin/package.json | 6 +++--- packages/experimental-utils/CHANGELOG.md | 8 ++++++++ packages/experimental-utils/package.json | 8 ++++---- packages/parser/CHANGELOG.md | 8 ++++++++ packages/parser/package.json | 10 +++++----- packages/scope-manager/CHANGELOG.md | 8 ++++++++ packages/scope-manager/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 8 ++++++++ packages/shared-fixtures/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 8 ++++++++ packages/typescript-estree/package.json | 8 ++++---- packages/visitor-keys/CHANGELOG.md | 8 ++++++++ packages/visitor-keys/package.json | 4 ++-- 24 files changed, 127 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6756dd203..efdec205c75 100644 --- a/CHANGELOG.md +++ b/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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/typescript-eslint + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/typescript-eslint diff --git a/lerna.json b/lerna.json index f9690434936..5fa41e9157c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "4.28.3", + "version": "4.28.4", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index ead1056ce9f..a290ca85215 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 e5f525916ed..e37995c57b9 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "4.28.3", + "version": "4.28.4", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index b31107fa227..0ee465ed4e9 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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 c32aabf3bee..0ae43a471fc 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": "4.28.3", + "version": "4.28.4", "private": true, "main": "dist/index.js", "scripts": { @@ -14,7 +14,7 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "4.28.3", + "@typescript-eslint/experimental-utils": "4.28.4", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index f0b94a6d9b7..63672ea436b 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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 9797a1a925e..61354ebd7f0 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": "4.28.3", + "version": "4.28.4", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.3", + "@typescript-eslint/experimental-utils": "4.28.4", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "4.28.3" + "@typescript-eslint/parser": "4.28.4" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index e02ff4b4c9d..ecaff23096b 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index b757ab04647..551d55df0bd 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "4.28.3", + "version": "4.28.4", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,8 +44,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.3", - "@typescript-eslint/scope-manager": "4.28.3", + "@typescript-eslint/experimental-utils": "4.28.4", + "@typescript-eslint/scope-manager": "4.28.4", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index b7c0740a4b8..66f3bc8bbad 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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 27e3a328268..0d8a7d29663 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "4.28.3", + "version": "4.28.4", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.28.3", - "@typescript-eslint/types": "4.28.3", - "@typescript-eslint/typescript-estree": "4.28.3", + "@typescript-eslint/scope-manager": "4.28.4", + "@typescript-eslint/types": "4.28.4", + "@typescript-eslint/typescript-estree": "4.28.4", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index cb6b0ffca4a..b4a7dc14665 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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index f401713d641..95368f9fbc7 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "4.28.3", + "version": "4.28.4", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,14 +44,14 @@ "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "4.28.3", - "@typescript-eslint/types": "4.28.3", - "@typescript-eslint/typescript-estree": "4.28.3", + "@typescript-eslint/scope-manager": "4.28.4", + "@typescript-eslint/types": "4.28.4", + "@typescript-eslint/typescript-estree": "4.28.4", "debug": "^4.3.1" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/experimental-utils": "4.28.3", + "@typescript-eslint/experimental-utils": "4.28.4", "glob": "*", "typescript": "*" }, diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index ac73210cd4c..a7230251837 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 86416b0f357..5003729ef86 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "4.28.3", + "version": "4.28.4", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.28.3", - "@typescript-eslint/visitor-keys": "4.28.3" + "@typescript-eslint/types": "4.28.4", + "@typescript-eslint/visitor-keys": "4.28.4" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "4.28.3", + "@typescript-eslint/typescript-estree": "4.28.4", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 1041ae190cd..7887f29091a 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index abd3edbb3fa..e567a7076a0 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "4.28.3", + "version": "4.28.4", "private": true } diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 0054ec2bff0..5c19f02589c 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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 486965fa423..84897fb773b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "4.28.3", + "version": "4.28.4", "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 31e48ba5166..8ae4ba83c85 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 96e861c9c55..a933f4c1d57 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "4.28.3", + "version": "4.28.4", "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": "4.28.3", - "@typescript-eslint/visitor-keys": "4.28.3", + "@typescript-eslint/types": "4.28.4", + "@typescript-eslint/visitor-keys": "4.28.4", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "4.28.3", + "@typescript-eslint/shared-fixtures": "4.28.4", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 9bcd665dcb4..a56f6e2ba29 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. +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **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 8e4ad403c5e..78e0b1eae1d 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "4.28.3", + "version": "4.28.4", "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": "4.28.3", + "@typescript-eslint/types": "4.28.4", "eslint-visitor-keys": "^2.0.0" }, "devDependencies": { From d3587857227526594f05a1d96515afe3c2ee0545 Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 23 Jul 2021 14:06:03 +0400 Subject: [PATCH 03/27] chore: migrate to nx 12.6.0 and distributed workspace config (#3652) --- nx.json | 51 +- package.json | 12 +- packages/ast-spec/project.json | 5 + packages/eslint-plugin-internal/project.json | 5 + packages/eslint-plugin-tslint/project.json | 5 + packages/eslint-plugin/project.json | 5 + packages/experimental-utils/project.json | 5 + packages/parser/project.json | 5 + packages/scope-manager/project.json | 5 + packages/shared-fixtures/project.json | 5 + packages/types/project.json | 5 + packages/typescript-estree/project.json | 5 + packages/visitor-keys/project.json | 5 + tsconfig.base.json | 3 +- workspace.json | 55 +- yarn.lock | 711 ++++++++++++++++--- 16 files changed, 717 insertions(+), 170 deletions(-) create mode 100644 packages/ast-spec/project.json create mode 100644 packages/eslint-plugin-internal/project.json create mode 100644 packages/eslint-plugin-tslint/project.json create mode 100644 packages/eslint-plugin/project.json create mode 100644 packages/experimental-utils/project.json create mode 100644 packages/parser/project.json create mode 100644 packages/scope-manager/project.json create mode 100644 packages/shared-fixtures/project.json create mode 100644 packages/types/project.json create mode 100644 packages/typescript-estree/project.json create mode 100644 packages/visitor-keys/project.json diff --git a/nx.json b/nx.json index 361ed34b99a..a417643d66a 100644 --- a/nx.json +++ b/nx.json @@ -1,14 +1,15 @@ { "npmScope": "typescript-eslint", "implicitDependencies": { - "workspace.json": "*", "package.json": { "dependencies": "*", "devDependencies": "*" }, - "nx.json": "*", ".github/workflows/ci.yml": "*" }, + "affected": { + "defaultBase": "master" + }, "workspaceLayout": { "libsDir": "packages" }, @@ -17,7 +18,6 @@ "runner": "@nrwl/nx-cloud", "options": { "cacheableOperations": ["build", "test", "package", "prepare"], - "strictlyOrderedTargets": ["build", "package", "prepare"], "accessToken": "YjFjNTBhOWUtY2JmNy00ZDhiLWE5N2UtZjliNDAwNmIzOTdjfHJlYWQtd3JpdGU=", "canTrackAnalytics": false, "showUsageWarnings": true, @@ -25,42 +25,13 @@ } } }, - "projects": { - "@typescript-eslint/ast-spec": { - "implicitDependencies": [] - }, - "@typescript-eslint/eslint-plugin": { - "implicitDependencies": [] - }, - "@typescript-eslint/eslint-plugin-internal": { - "implicitDependencies": [] - }, - "@typescript-eslint/eslint-plugin-tslint": { - "implicitDependencies": [] - }, - "@typescript-eslint/experimental-utils": { - "implicitDependencies": [] - }, - "@typescript-eslint/parser": { - "implicitDependencies": [] - }, - "@typescript-eslint/scope-manager": { - "implicitDependencies": [] - }, - "@typescript-eslint/shared-fixtures": { - "implicitDependencies": [] - }, - "@typescript-eslint/types": { - "implicitDependencies": ["@typescript-eslint/ast-spec"] - }, - "@typescript-eslint/typescript-estree": { - "implicitDependencies": [] - }, - "@typescript-eslint/visitor-keys": { - "implicitDependencies": [] - } + "targetDependencies": { + "build": [ + { + "target": "build", + "projects": "dependencies" + } + ] }, - "affected": { - "defaultBase": "master" - } + "projects": {} } diff --git a/package.json b/package.json index 8b13e068b35..a04cb34c321 100644 --- a/package.json +++ b/package.json @@ -77,10 +77,10 @@ "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", "@commitlint/config-lerna-scopes": "^12.1.4", - "@nrwl/cli": "^12.3.5", - "@nrwl/nx-cloud": "^12.1.3", - "@nrwl/tao": "^12.3.5", - "@nrwl/workspace": "^12.3.5", + "@nrwl/cli": "12.6.0", + "@nrwl/nx-cloud": "12.3.0", + "@nrwl/tao": "12.6.0", + "@nrwl/workspace": "12.6.0", "@types/babel__code-frame": "^7.0.2", "@types/debug": "^4.1.5", "@types/eslint-visitor-keys": "^1.0.0", @@ -115,7 +115,7 @@ "make-dir": "^3.1.0", "markdownlint-cli": "^0.27.1", "node-fetch": "^2.6.1", - "prettier": "^2.3.0", + "prettier": "2.3.2", "pretty-format": "^27.0.2", "rimraf": "^3.0.2", "ts-jest": "^27.0.1", @@ -127,6 +127,6 @@ "@types/node": "^15.6.1", "jest-diff": "^27.0.0", "pretty-format": "^27.0.0", - "typescript": "4.3.2" + "typescript": "4.3.5" } } diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json new file mode 100644 index 00000000000..3cb2cf7be65 --- /dev/null +++ b/packages/ast-spec/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/ast-spec", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/eslint-plugin-internal/project.json b/packages/eslint-plugin-internal/project.json new file mode 100644 index 00000000000..948fce1f60c --- /dev/null +++ b/packages/eslint-plugin-internal/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/eslint-plugin-internal", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/eslint-plugin-tslint/project.json b/packages/eslint-plugin-tslint/project.json new file mode 100644 index 00000000000..8ca785bd7d1 --- /dev/null +++ b/packages/eslint-plugin-tslint/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/eslint-plugin-tslint", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json new file mode 100644 index 00000000000..d04cdcb07b1 --- /dev/null +++ b/packages/eslint-plugin/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/eslint-plugin", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/experimental-utils/project.json b/packages/experimental-utils/project.json new file mode 100644 index 00000000000..f8bd9117eea --- /dev/null +++ b/packages/experimental-utils/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/experimental-utils", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/parser/project.json b/packages/parser/project.json new file mode 100644 index 00000000000..c9c9e3b6321 --- /dev/null +++ b/packages/parser/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/parser", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/scope-manager/project.json b/packages/scope-manager/project.json new file mode 100644 index 00000000000..702250b8421 --- /dev/null +++ b/packages/scope-manager/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/scope-manager", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/shared-fixtures/project.json b/packages/shared-fixtures/project.json new file mode 100644 index 00000000000..b100b1e4ba7 --- /dev/null +++ b/packages/shared-fixtures/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/shared-fixtures", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/types/project.json b/packages/types/project.json new file mode 100644 index 00000000000..d0c5660433f --- /dev/null +++ b/packages/types/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/types", + "type": "library", + "implicitDependencies": ["@typescript-eslint/ast-spec"] +} diff --git a/packages/typescript-estree/project.json b/packages/typescript-estree/project.json new file mode 100644 index 00000000000..a3e44b64373 --- /dev/null +++ b/packages/typescript-estree/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/typescript-estree", + "type": "library", + "implicitDependencies": [] +} diff --git a/packages/visitor-keys/project.json b/packages/visitor-keys/project.json new file mode 100644 index 00000000000..e531f19f69d --- /dev/null +++ b/packages/visitor-keys/project.json @@ -0,0 +1,5 @@ +{ + "root": "packages/visitor-keys", + "type": "library", + "implicitDependencies": [] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index ee6c33f86e5..0c43c219c07 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,6 +15,7 @@ "sourceMap": true, "strict": true, "target": "es2017", - "lib": ["es2017"] + "lib": ["es2017"], + "paths": {} } } diff --git a/workspace.json b/workspace.json index 8ff12044156..c6dbc5b4b0f 100644 --- a/workspace.json +++ b/workspace.json @@ -1,49 +1,16 @@ { "version": 2, "projects": { - "@typescript-eslint/ast-spec": { - "root": "packages/ast-spec", - "type": "library" - }, - "@typescript-eslint/eslint-plugin": { - "root": "packages/eslint-plugin", - "type": "library" - }, - "@typescript-eslint/eslint-plugin-internal": { - "root": "packages/eslint-plugin-internal", - "type": "library" - }, - "@typescript-eslint/eslint-plugin-tslint": { - "root": "packages/eslint-plugin-tslint", - "type": "library" - }, - "@typescript-eslint/experimental-utils": { - "root": "packages/experimental-utils", - "type": "library" - }, - "@typescript-eslint/parser": { - "root": "packages/parser", - "type": "library" - }, - "@typescript-eslint/scope-manager": { - "root": "packages/scope-manager", - "type": "library" - }, - "@typescript-eslint/shared-fixtures": { - "root": "packages/shared-fixtures", - "type": "library" - }, - "@typescript-eslint/types": { - "root": "packages/types", - "type": "library" - }, - "@typescript-eslint/typescript-estree": { - "root": "packages/typescript-estree", - "type": "library" - }, - "@typescript-eslint/visitor-keys": { - "root": "packages/visitor-keys", - "type": "library" - } + "@typescript-eslint/ast-spec": "packages/ast-spec", + "@typescript-eslint/eslint-plugin": "packages/eslint-plugin", + "@typescript-eslint/eslint-plugin-internal": "packages/eslint-plugin-internal", + "@typescript-eslint/eslint-plugin-tslint": "packages/eslint-plugin-tslint", + "@typescript-eslint/experimental-utils": "packages/experimental-utils", + "@typescript-eslint/parser": "packages/parser", + "@typescript-eslint/scope-manager": "packages/scope-manager", + "@typescript-eslint/shared-fixtures": "packages/shared-fixtures", + "@typescript-eslint/types": "packages/types", + "@typescript-eslint/typescript-estree": "packages/typescript-estree", + "@typescript-eslint/visitor-keys": "packages/visitor-keys" } } diff --git a/yarn.lock b/yarn.lock index 55590585174..9810d184e89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -792,6 +792,18 @@ jest-util "^27.0.2" slash "^3.0.0" +"@jest/console@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.6.tgz#3eb72ea80897495c3d73dd97aab7f26770e2260f" + integrity sha512-fMlIBocSHPZ3JxgWiDNW/KPj6s+YRd0hicb33IrmelCcjXo/pXPwvuiKFmZz+XuqI/1u7nbUK10zSsWL/1aegg== + dependencies: + "@jest/types" "^27.0.6" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^27.0.6" + jest-util "^27.0.6" + slash "^3.0.0" + "@jest/core@^27.0.4": version "27.0.4" resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.4.tgz#679bf9ac07900da2ddbb9667bb1afa8029038f53" @@ -837,6 +849,16 @@ "@types/node" "*" jest-mock "^27.0.3" +"@jest/environment@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.6.tgz#ee293fe996db01d7d663b8108fa0e1ff436219d2" + integrity sha512-4XywtdhwZwCpPJ/qfAkqExRsERW+UaoSRStSHCCiQTUpoYdLukj+YJbQSFrZjhlUDRZeNiU9SFH0u7iNimdiIg== + dependencies: + "@jest/fake-timers" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/node" "*" + jest-mock "^27.0.6" + "@jest/fake-timers@^27.0.3": version "27.0.3" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.3.tgz#9899ba6304cc636734c74478df502e18136461dd" @@ -849,6 +871,18 @@ jest-mock "^27.0.3" jest-util "^27.0.2" +"@jest/fake-timers@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.6.tgz#cbad52f3fe6abe30e7acb8cd5fa3466b9588e3df" + integrity sha512-sqd+xTWtZ94l3yWDKnRTdvTeZ+A/V7SSKrxsrOKSqdyddb9CeNRF8fbhAU0D7ZJBpTTW2nbp6MftmKJDZfW2LQ== + dependencies: + "@jest/types" "^27.0.6" + "@sinonjs/fake-timers" "^7.0.2" + "@types/node" "*" + jest-message-util "^27.0.6" + jest-mock "^27.0.6" + jest-util "^27.0.6" + "@jest/globals@^27.0.3": version "27.0.3" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.3.tgz#1cf8933b7791bba0b99305cbf39fd4d2e3fe4060" @@ -858,6 +892,45 @@ "@jest/types" "^27.0.2" expect "^27.0.2" +"@jest/globals@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.6.tgz#48e3903f99a4650673d8657334d13c9caf0e8f82" + integrity sha512-DdTGCP606rh9bjkdQ7VvChV18iS7q0IMJVP1piwTWyWskol4iqcVwthZmoJEf7obE1nc34OpIyoVGPeqLC+ryw== + dependencies: + "@jest/environment" "^27.0.6" + "@jest/types" "^27.0.6" + expect "^27.0.6" + +"@jest/reporters@27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.6.tgz#91e7f2d98c002ad5df94d5b5167c1eb0b9fd5b00" + integrity sha512-TIkBt09Cb2gptji3yJXb3EE+eVltW6BjO7frO7NEfjI9vSIYoISi5R3aI3KpEDXlB1xwB+97NXIqz84qYeYsfA== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.2.4" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^4.0.3" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + jest-haste-map "^27.0.6" + jest-resolve "^27.0.6" + jest-util "^27.0.6" + jest-worker "^27.0.6" + slash "^3.0.0" + source-map "^0.6.0" + string-length "^4.0.1" + terminal-link "^2.0.0" + v8-to-istanbul "^8.0.0" + "@jest/reporters@^27.0.4": version "27.0.4" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.4.tgz#95609b1be97afb80d55d8aa3d7c3179c15810e65" @@ -897,6 +970,25 @@ graceful-fs "^4.2.4" source-map "^0.6.0" +"@jest/source-map@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" + integrity sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.2.4" + source-map "^0.6.0" + +"@jest/test-result@27.0.6", "@jest/test-result@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.6.tgz#3fa42015a14e4fdede6acd042ce98c7f36627051" + integrity sha512-ja/pBOMTufjX4JLEauLxE3LQBPaI2YjGFtXexRAjt1I/MbfNlMx0sytSX3tn5hSLzQsR3Qy2rd0hc1BWojtj9w== + dependencies: + "@jest/console" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + "@jest/test-result@^27.0.2": version "27.0.2" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.2.tgz#0451049e32ceb609b636004ccc27c8fa22263f10" @@ -917,6 +1009,16 @@ jest-haste-map "^27.0.2" jest-runtime "^27.0.4" +"@jest/test-sequencer@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.6.tgz#80a913ed7a1130545b1cd777ff2735dd3af5d34b" + integrity sha512-bISzNIApazYOlTHDum9PwW22NOyDa6VI31n6JucpjTVM0jD6JDgqEZ9+yn575nDdPF0+4csYDxNNW13NvFQGZA== + dependencies: + "@jest/test-result" "^27.0.6" + graceful-fs "^4.2.4" + jest-haste-map "^27.0.6" + jest-runtime "^27.0.6" + "@jest/transform@^27.0.2": version "27.0.2" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.2.tgz#b073b7c589e3f4b842102468875def2bb722d6b5" @@ -938,16 +1040,26 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== +"@jest/transform@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.6.tgz#189ad7107413208f7600f4719f81dd2f7278cc95" + integrity sha512-rj5Dw+mtIcntAUnMlW/Vju5mr73u8yg+irnHwzgtgoeI6cCPOvUwQ0D1uQtc/APmWgvRweEb1g05pkUpxH3iCA== dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" + "@babel/core" "^7.1.0" + "@jest/types" "^27.0.6" + babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^27.0.6" + jest-regex-util "^27.0.6" + jest-util "^27.0.6" + micromatch "^4.0.4" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" "@jest/types@^27.0.2": version "27.0.2" @@ -960,6 +1072,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.6.tgz#9a992bc517e0c49f035938b8549719c2de40706b" + integrity sha512-aSquT1qa9Pik26JK5/3rvnYb4bGtm1VFNesHKmNTwmPIgOrixvhL2ghIvFRNEpzy3gU+rUgjIF/KodbkFAl++g== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@lerna/add@3.21.0": version "3.21.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.21.0.tgz#27007bde71cc7b0a2969ab3c2f0ae41578b4577b" @@ -1721,53 +1844,60 @@ "@nodelib/fs.scandir" "2.1.3" fastq "^1.6.0" -"@nrwl/cli@12.4.0", "@nrwl/cli@^12.3.5": - version "12.4.0" - resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-12.4.0.tgz#d313ddbabfef0d4b1b3e799dac5fa1dafe4819d4" - integrity sha512-ZU1NAjxEa9iMRRhUCYmD0ZLlK1j5l+zDseDE1a0A3KdgMVGh2eOchREnf6R75skQJHl4v9hKFweqiy0Xl14ZRQ== +"@nrwl/cli@12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-12.6.0.tgz#c5104bbe7b7c5fa8674e53858e21c9022eff7d58" + integrity sha512-gzQ2QWUCTxC2tNVg+9gPAGxO9RVrF+35Q1SidC4I8VxXh7uhzEp5aweWnfTHSBuefPzqpKDxsjco4070z0c3zQ== dependencies: - "@nrwl/tao" "12.4.0" + "@nrwl/tao" "12.6.0" chalk "4.1.0" v8-compile-cache "2.3.0" yargs "15.4.1" yargs-parser "20.0.0" -"@nrwl/devkit@12.4.0": - version "12.4.0" - resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-12.4.0.tgz#6110327f1aed6d87d407929651e6f1140c779451" - integrity sha512-kGw5/SH4ze4j+rG6seEcslNenscrZFZMGpcoc3OIxfTTGlFA0mCFasFgzN8osgTX4+PgEOushvm3yRAaMmLqIg== +"@nrwl/devkit@12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-12.6.0.tgz#a2bdd4c144f05597302580bcf31443abdd9dc6be" + integrity sha512-tvw/4n2JD/38UuzdxFCoj1+x02BAKK4EvtLhwUK5XSBF0wDYFBp5rHfxvUD9ZcoiRRrZA4QGFjhDljrfj95F2A== dependencies: - "@nrwl/tao" "12.4.0" + "@nrwl/tao" "12.6.0" ejs "^3.1.5" ignore "^5.0.4" + rxjs "^6.5.4" semver "7.3.4" tslib "^2.0.0" -"@nrwl/jest@12.4.0": - version "12.4.0" - resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-12.4.0.tgz#d59b840ba1ad79ff969aefa353ad360e952bd86c" - integrity sha512-YZbo4+NYsSp7StJFvY7pKAArpYOP5AtZAu4ltshzdAWYM9KgPtoDtstRBksFzDq6jnApXuMb4eEcE4ttlMj3yQ== +"@nrwl/jest@12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-12.6.0.tgz#4ae63b175c2a3a189267606d4e3796d0c4c406eb" + integrity sha512-xg9tqKgY1XIhA7GOhW9D9g3i3ulLa/Ofjuse0vPNG/e9qRrOUKAdK88OB5CB0AbrARCplf9//45i5NoeW9ZzDA== dependencies: - "@nrwl/devkit" "12.4.0" - jest-resolve "^26.6.2" + "@jest/reporters" "27.0.6" + "@jest/test-result" "27.0.6" + "@nrwl/devkit" "12.6.0" + chalk "4.1.0" + identity-obj-proxy "3.0.0" + jest-config "27.0.6" + jest-resolve "27.0.6" + jest-util "27.0.6" rxjs "^6.5.4" tslib "^2.0.0" -"@nrwl/linter@12.4.0": - version "12.4.0" - resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-12.4.0.tgz#61afc3d1bfb9e71ceea1ed820d15f4163911c00b" - integrity sha512-n+xEKSAU5nVyMii7GtvBWDdjtrlCqMXrnozBs586k+bL0opogP4ZOrWxPZUjLnOlOHx1BuIl0nViSjBmh2y0wA== +"@nrwl/linter@12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-12.6.0.tgz#b102b481a166a9ead4a1df1a05bcaa81305f31ab" + integrity sha512-qOk6tOUqwLNYmeNNLFUgnbEr+v2G9VqZUBUWpVWT8PR78Rd0vI2AJDkE/VrjPKIfHzbXraKTuWcwTCijX8324w== dependencies: - "@nrwl/devkit" "12.4.0" + "@nrwl/devkit" "12.6.0" glob "7.1.4" minimatch "3.0.4" tmp "~0.2.1" tslib "^2.0.0" -"@nrwl/nx-cloud@^12.1.3": - version "12.2.4" - resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-12.2.4.tgz#a6b054a627e6c68741ce503ebb414e9e80b60561" - integrity sha512-q1tqh87VqPZhvByOMit6q9aWF0MjRx1ItqQFQvwXOBx0Hx8z/8UfRgSwPK5AQBL7Npue10KMgwAooR4r/nvvMw== +"@nrwl/nx-cloud@12.3.0": + version "12.3.0" + resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-12.3.0.tgz#2f461d566b98441c585ecf93010faf066e1199bf" + integrity sha512-woWvAqp8fWXSl0a+tijo3FtrrjXvGTir89XNhUdh7jvzq7P4+XiPIt6slgcRD3X3ew3JNkJterzf+188fQH8aQ== dependencies: axios "^0.21.1" chalk "4.1.0" @@ -1776,10 +1906,10 @@ strip-json-comments "^3.1.1" tar "5.0.5" -"@nrwl/tao@12.4.0", "@nrwl/tao@^12.3.5": - version "12.4.0" - resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-12.4.0.tgz#90620513fc66faca22c98a64623b2d1c058bb1a4" - integrity sha512-WH8SqOuJuuBwXpLX9vIVVWEovDqfLmiyFQS4Ebz35KWXNoIv9MS3QgItXKCu7X463hiJnxjAA3RqVYIt8U1vXg== +"@nrwl/tao@12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-12.6.0.tgz#b0ef91cbc0a8b7747407d1f25b0be669d9a8ddc7" + integrity sha512-h6X+mqmTlZjA9nqlyPAu9TFNORHAMcC1BD8H8kA8lTHN1nktLHQ266qpHVLsxcqww2EYsVqQaKaOpUacck49+w== dependencies: chalk "4.1.0" enquirer "~2.3.6" @@ -1792,16 +1922,17 @@ tslib "^2.0.0" yargs-parser "20.0.0" -"@nrwl/workspace@^12.3.5": - version "12.4.0" - resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-12.4.0.tgz#095d29bbb1d19f6266af06c528ebc83392d07654" - integrity sha512-RjcvP4rQCj6CQPDrRTLlzviF6kskfDBfBlyrQfDjh4CC9HasjlRCOfB39OQynT2M4iZqckXl5upG7Ph1gP5+dg== +"@nrwl/workspace@12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-12.6.0.tgz#101fda472268008ca64ac5478b95ae17735f93b4" + integrity sha512-g7RqXHLWiB7dO6YhH0Vcb1JRs/q/lSA49Q5DzJqXrVng63LA0wBovmFdOF9slcYNcsow35cDBgWvup+BQgq6gg== dependencies: - "@nrwl/cli" "12.4.0" - "@nrwl/devkit" "12.4.0" - "@nrwl/jest" "12.4.0" - "@nrwl/linter" "12.4.0" + "@nrwl/cli" "12.6.0" + "@nrwl/devkit" "12.6.0" + "@nrwl/jest" "12.6.0" + "@nrwl/linter" "12.6.0" chalk "4.1.0" + chokidar "^3.5.1" cosmiconfig "^4.0.0" dotenv "8.2.0" enquirer "~2.3.6" @@ -2198,13 +2329,6 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== -"@types/yargs@^15.0.0": - version "15.0.13" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.13.tgz#34f7fec8b389d7f3c1fd08026a5763e072d3c6dc" - integrity sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^16.0.0": version "16.0.3" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.3.tgz#4b6d35bb8e680510a7dc2308518a80ee1ef27e01" @@ -2409,6 +2533,14 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -2614,6 +2746,20 @@ babel-jest@^27.0.2: graceful-fs "^4.2.4" slash "^3.0.0" +babel-jest@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.6.tgz#e99c6e0577da2655118e3608b68761a5a69bd0d8" + integrity sha512-iTJyYLNc4wRofASmofpOc5NK9QunwMk+TLFgGXsTFS8uEqmd8wdI7sga0FPe2oVH3b5Agt/EAK1QjPEuKL8VfA== + dependencies: + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^27.0.6" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + babel-plugin-istanbul@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" @@ -2635,6 +2781,16 @@ babel-plugin-jest-hoist@^27.0.1: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" +babel-plugin-jest-hoist@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456" + integrity sha512-CewFeM9Vv2gM7Yr9n5eyyLVPRSiBnk6lKZRjgwYnGKSl9M14TMn2vkN02wTF04OGuSDLEzlWiMzvjXuW9mB6Gw== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.0.0" + "@types/babel__traverse" "^7.0.6" + babel-preset-current-node-syntax@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" @@ -2661,6 +2817,14 @@ babel-preset-jest@^27.0.1: babel-plugin-jest-hoist "^27.0.1" babel-preset-current-node-syntax "^1.0.0" +babel-preset-jest@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d" + integrity sha512-WObA0/Biw2LrVVwZkF/2GqbOdzhKD6Fkdwhoy9ASIrOWr/zodcSpQh72JOkEn6NWyjmnPDjNSqaGN4KnpKzhXw== + dependencies: + babel-plugin-jest-hoist "^27.0.6" + babel-preset-current-node-syntax "^1.0.0" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -2691,6 +2855,11 @@ before-after-hook@^2.0.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -2720,7 +2889,7 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2956,6 +3125,21 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +chokidar@^3.5.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.1, chownr@^1.1.2, chownr@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -4252,6 +4436,18 @@ expect@^27.0.2: jest-message-util "^27.0.2" jest-regex-util "^27.0.1" +expect@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05" + integrity sha512-psNLt8j2kwg42jGBDSfAlU49CEZxejN1f1PlANWDZqIhBOVU/c2Pm888FcjWJzFewhIsNWfZJeLjUjtKGiPuSw== + dependencies: + "@jest/types" "^27.0.6" + ansi-styles "^5.0.0" + jest-get-type "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-regex-util "^27.0.6" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -4609,7 +4805,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.3.2: +fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -4802,6 +4998,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0: dependencies: is-glob "^4.0.1" +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -4938,6 +5141,11 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== +harmony-reflect@^1.4.6: + version "1.6.2" + resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.2.tgz#31ecbd32e648a34d030d86adb67d4d47547fe710" + integrity sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g== + has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" @@ -5108,6 +5316,13 @@ iconv-lite@^0.6.2, iconv-lite@^0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +identity-obj-proxy@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" + integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ= + dependencies: + harmony-reflect "^1.4.6" + iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" @@ -5313,6 +5528,13 @@ is-bigint@^1.0.1: resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + is-boolean-object@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" @@ -5449,7 +5671,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0, is-glob@^4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== @@ -5703,6 +5925,31 @@ jest-circus@^27.0.4: stack-utils "^2.0.3" throat "^6.0.1" +jest-circus@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.6.tgz#dd4df17c4697db6a2c232aaad4e9cec666926668" + integrity sha512-OJlsz6BBeX9qR+7O9lXefWoc2m9ZqcZ5Ohlzz0pTEAG4xMiZUJoacY8f4YDHxgk0oKYxj277AfOk9w6hZYvi1Q== + dependencies: + "@jest/environment" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + expect "^27.0.6" + is-generator-fn "^2.0.0" + jest-each "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-runtime "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + pretty-format "^27.0.6" + slash "^3.0.0" + stack-utils "^2.0.3" + throat "^6.0.1" + jest-cli@^27.0.4: version "27.0.4" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.4.tgz#491b12c754c0d7c6873b13a66f26b3a80a852910" @@ -5721,6 +5968,33 @@ jest-cli@^27.0.4: prompts "^2.0.1" yargs "^16.0.3" +jest-config@27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.6.tgz#119fb10f149ba63d9c50621baa4f1f179500277f" + integrity sha512-JZRR3I1Plr2YxPBhgqRspDE2S5zprbga3swYNrvY3HfQGu7p/GjyLOqwrYad97tX3U3mzT53TPHVmozacfP/3w== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^27.0.6" + "@jest/types" "^27.0.6" + babel-jest "^27.0.6" + chalk "^4.0.0" + deepmerge "^4.2.2" + glob "^7.1.1" + graceful-fs "^4.2.4" + is-ci "^3.0.0" + jest-circus "^27.0.6" + jest-environment-jsdom "^27.0.6" + jest-environment-node "^27.0.6" + jest-get-type "^27.0.6" + jest-jasmine2 "^27.0.6" + jest-regex-util "^27.0.6" + jest-resolve "^27.0.6" + jest-runner "^27.0.6" + jest-util "^27.0.6" + jest-validate "^27.0.6" + micromatch "^4.0.4" + pretty-format "^27.0.6" + jest-config@^27.0.4: version "27.0.4" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.4.tgz#c4f41378acf40ca77860fb4e213b12109d87b8cf" @@ -5748,7 +6022,7 @@ jest-config@^27.0.4: micromatch "^4.0.4" pretty-format "^27.0.2" -jest-diff@^26.0.0, jest-diff@^27.0.0, jest-diff@^27.0.2: +jest-diff@^26.0.0, jest-diff@^27.0.0, jest-diff@^27.0.2, jest-diff@^27.0.6: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.2.tgz#f315b87cee5dc134cf42c2708ab27375cc3f5a7e" integrity sha512-BFIdRb0LqfV1hBt8crQmw6gGQHVDhM87SpMIZ45FPYKReZYG5er1+5pIn2zKqvrJp6WNox0ylR8571Iwk2Dmgw== @@ -5765,6 +6039,13 @@ jest-docblock@^27.0.1: dependencies: detect-newline "^3.0.0" +jest-docblock@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" + integrity sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA== + dependencies: + detect-newline "^3.0.0" + jest-each@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.2.tgz#865ddb4367476ced752167926b656fa0dcecd8c7" @@ -5776,6 +6057,17 @@ jest-each@^27.0.2: jest-util "^27.0.2" pretty-format "^27.0.2" +jest-each@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.6.tgz#cee117071b04060158dc8d9a66dc50ad40ef453b" + integrity sha512-m6yKcV3bkSWrUIjxkE9OC0mhBZZdhovIW5ergBYirqnkLXkyEn3oUUF/QZgyecA1cF1QFyTE8bRRl8Tfg1pfLA== + dependencies: + "@jest/types" "^27.0.6" + chalk "^4.0.0" + jest-get-type "^27.0.6" + jest-util "^27.0.6" + pretty-format "^27.0.6" + jest-environment-jsdom@^27.0.3: version "27.0.3" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.3.tgz#ed73e913ddc03864eb9f934b5cbabf1b63504e2e" @@ -5789,6 +6081,19 @@ jest-environment-jsdom@^27.0.3: jest-util "^27.0.2" jsdom "^16.6.0" +jest-environment-jsdom@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.6.tgz#f66426c4c9950807d0a9f209c590ce544f73291f" + integrity sha512-FvetXg7lnXL9+78H+xUAsra3IeZRTiegA3An01cWeXBspKXUhAwMM9ycIJ4yBaR0L7HkoMPaZsozCLHh4T8fuw== + dependencies: + "@jest/environment" "^27.0.6" + "@jest/fake-timers" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/node" "*" + jest-mock "^27.0.6" + jest-util "^27.0.6" + jsdom "^16.6.0" + jest-environment-node@^27.0.3: version "27.0.3" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.3.tgz#b4acb3679d2552a4215732cab8b0ca7ec4398ee0" @@ -5801,11 +6106,28 @@ jest-environment-node@^27.0.3: jest-mock "^27.0.3" jest-util "^27.0.2" +jest-environment-node@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.6.tgz#a6699b7ceb52e8d68138b9808b0c404e505f3e07" + integrity sha512-+Vi6yLrPg/qC81jfXx3IBlVnDTI6kmRr08iVa2hFCWmJt4zha0XW7ucQltCAPhSR0FEKEoJ3i+W4E6T0s9is0w== + dependencies: + "@jest/environment" "^27.0.6" + "@jest/fake-timers" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/node" "*" + jest-mock "^27.0.6" + jest-util "^27.0.6" + jest-get-type@^27.0.1: version "27.0.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.1.tgz#34951e2b08c8801eb28559d7eb732b04bbcf7815" integrity sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg== +jest-get-type@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" + integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== + jest-haste-map@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.2.tgz#3f1819400c671237e48b4d4b76a80a0dbed7577f" @@ -5826,6 +6148,26 @@ jest-haste-map@^27.0.2: optionalDependencies: fsevents "^2.3.2" +jest-haste-map@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.6.tgz#4683a4e68f6ecaa74231679dca237279562c8dc7" + integrity sha512-4ldjPXX9h8doB2JlRzg9oAZ2p6/GpQUNAeiYXqcpmrKbP0Qev0wdZlxSMOmz8mPOEnt4h6qIzXFLDi8RScX/1w== + dependencies: + "@jest/types" "^27.0.6" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^27.0.6" + jest-serializer "^27.0.6" + jest-util "^27.0.6" + jest-worker "^27.0.6" + micromatch "^4.0.4" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + jest-jasmine2@^27.0.4: version "27.0.4" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.4.tgz#c669519ccf4904a485338555e1e66cad36bb0670" @@ -5850,6 +6192,30 @@ jest-jasmine2@^27.0.4: pretty-format "^27.0.2" throat "^6.0.1" +jest-jasmine2@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.6.tgz#fd509a9ed3d92bd6edb68a779f4738b100655b37" + integrity sha512-cjpH2sBy+t6dvCeKBsHpW41mjHzXgsavaFMp+VWRf0eR4EW8xASk1acqmljFtK2DgyIECMv2yCdY41r2l1+4iA== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^27.0.6" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + expect "^27.0.6" + is-generator-fn "^2.0.0" + jest-each "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-runtime "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + pretty-format "^27.0.6" + throat "^6.0.1" + jest-leak-detector@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.2.tgz#ce19aa9dbcf7a72a9d58907a970427506f624e69" @@ -5858,6 +6224,14 @@ jest-leak-detector@^27.0.2: jest-get-type "^27.0.1" pretty-format "^27.0.2" +jest-leak-detector@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.6.tgz#545854275f85450d4ef4b8fe305ca2a26450450f" + integrity sha512-2/d6n2wlH5zEcdctX4zdbgX8oM61tb67PQt4Xh8JFAIy6LRKUnX528HulkaG6nD5qDl5vRV1NXejCe1XRCH5gQ== + dependencies: + jest-get-type "^27.0.6" + pretty-format "^27.0.6" + jest-matcher-utils@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.2.tgz#f14c060605a95a466cdc759acc546c6f4cbfc4f0" @@ -5868,6 +6242,16 @@ jest-matcher-utils@^27.0.2: jest-get-type "^27.0.1" pretty-format "^27.0.2" +jest-matcher-utils@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.6.tgz#2a8da1e86c620b39459f4352eaa255f0d43e39a9" + integrity sha512-OFgF2VCQx9vdPSYTHWJ9MzFCehs20TsyFi6bIHbk5V1u52zJOnvF0Y/65z3GLZHKRuTgVPY4Z6LVePNahaQ+tA== + dependencies: + chalk "^4.0.0" + jest-diff "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.0.6" + jest-message-util@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.2.tgz#181c9b67dff504d8f4ad15cba10d8b80f272048c" @@ -5883,6 +6267,21 @@ jest-message-util@^27.0.2: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.6.tgz#158bcdf4785706492d164a39abca6a14da5ab8b5" + integrity sha512-rBxIs2XK7rGy+zGxgi+UJKP6WqQ+KrBbD1YMj517HYN3v2BG66t3Xan3FWqYHKZwjdB700KiAJ+iES9a0M+ixw== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.0.6" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.4" + pretty-format "^27.0.6" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^27.0.3: version "27.0.3" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.3.tgz#5591844f9192b3335c0dca38e8e45ed297d4d23d" @@ -5891,6 +6290,14 @@ jest-mock@^27.0.3: "@jest/types" "^27.0.2" "@types/node" "*" +jest-mock@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.6.tgz#0efdd40851398307ba16778728f6d34d583e3467" + integrity sha512-lzBETUoK8cSxts2NYXSBWT+EJNzmUVtVVwS1sU9GwE1DLCfGsngg+ZVSIe0yd0ZSm+y791esiuo+WSwpXJQ5Bw== + dependencies: + "@jest/types" "^27.0.6" + "@types/node" "*" + jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" @@ -5901,6 +6308,11 @@ jest-regex-util@^27.0.1: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== +jest-regex-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" + integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== + jest-resolve-dependencies@^27.0.4: version "27.0.4" resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.4.tgz#a07a242d70d668afd3fcf7f4270755eebb1fe579" @@ -5910,18 +6322,19 @@ jest-resolve-dependencies@^27.0.4: jest-regex-util "^27.0.1" jest-snapshot "^27.0.4" -jest-resolve@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" - integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== +jest-resolve@27.0.6, jest-resolve@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.6.tgz#e90f436dd4f8fbf53f58a91c42344864f8e55bff" + integrity sha512-yKmIgw2LgTh7uAJtzv8UFHGF7Dm7XfvOe/LQ3Txv101fLM8cx2h1QVwtSJ51Q/SCxpIiKfVn6G2jYYMDNHZteA== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.6" chalk "^4.0.0" + escalade "^3.1.1" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^26.6.2" - read-pkg-up "^7.0.1" - resolve "^1.18.1" + jest-util "^27.0.6" + jest-validate "^27.0.6" + resolve "^1.20.0" slash "^3.0.0" jest-resolve@^27.0.2: @@ -5982,6 +6395,34 @@ jest-runner@^27.0.4: source-map-support "^0.5.6" throat "^6.0.1" +jest-runner@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.6.tgz#1325f45055539222bbc7256a6976e993ad2f9520" + integrity sha512-W3Bz5qAgaSChuivLn+nKOgjqNxM7O/9JOJoKDCqThPIg2sH/d4A/lzyiaFgnb9V1/w29Le11NpzTJSzga1vyYQ== + dependencies: + "@jest/console" "^27.0.6" + "@jest/environment" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.8.1" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-docblock "^27.0.6" + jest-environment-jsdom "^27.0.6" + jest-environment-node "^27.0.6" + jest-haste-map "^27.0.6" + jest-leak-detector "^27.0.6" + jest-message-util "^27.0.6" + jest-resolve "^27.0.6" + jest-runtime "^27.0.6" + jest-util "^27.0.6" + jest-worker "^27.0.6" + source-map-support "^0.5.6" + throat "^6.0.1" + jest-runtime@^27.0.4: version "27.0.4" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.4.tgz#2e4a6aa77cac32ac612dfe12768387a8aa15c2f0" @@ -6014,6 +6455,38 @@ jest-runtime@^27.0.4: strip-bom "^4.0.0" yargs "^16.0.3" +jest-runtime@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.6.tgz#45877cfcd386afdd4f317def551fc369794c27c9" + integrity sha512-BhvHLRVfKibYyqqEFkybsznKwhrsu7AWx2F3y9G9L95VSIN3/ZZ9vBpm/XCS2bS+BWz3sSeNGLzI3TVQ0uL85Q== + dependencies: + "@jest/console" "^27.0.6" + "@jest/environment" "^27.0.6" + "@jest/fake-timers" "^27.0.6" + "@jest/globals" "^27.0.6" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.4" + jest-haste-map "^27.0.6" + jest-message-util "^27.0.6" + jest-mock "^27.0.6" + jest-regex-util "^27.0.6" + jest-resolve "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + jest-validate "^27.0.6" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^16.0.3" + jest-serializer@^27.0.1: version "27.0.1" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.1.tgz#2464d04dcc33fb71dc80b7c82e3c5e8a08cb1020" @@ -6022,6 +6495,14 @@ jest-serializer@^27.0.1: "@types/node" "*" graceful-fs "^4.2.4" +jest-serializer@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" + integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + jest-snapshot@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.2.tgz#40c48dc6afd3cbc5d3d07c061f20fc10d94ca0cd" @@ -6082,6 +6563,36 @@ jest-snapshot@^27.0.4: pretty-format "^27.0.2" semver "^7.3.2" +jest-snapshot@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.6.tgz#f4e6b208bd2e92e888344d78f0f650bcff05a4bf" + integrity sha512-NTHaz8He+ATUagUgE7C/UtFcRoHqR2Gc+KDfhQIyx+VFgwbeEMjeP+ILpUTLosZn/ZtbNdCF5LkVnN/l+V751A== + dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/parser" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.0.0" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^27.0.6" + graceful-fs "^4.2.4" + jest-diff "^27.0.6" + jest-get-type "^27.0.6" + jest-haste-map "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-resolve "^27.0.6" + jest-util "^27.0.6" + natural-compare "^1.4.0" + pretty-format "^27.0.6" + semver "^7.3.2" + jest-specific-snapshot@*, jest-specific-snapshot@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-5.0.0.tgz#48f72d5613af7f3e30df75b6b3534db6bab32ea0" @@ -6089,17 +6600,17 @@ jest-specific-snapshot@*, jest-specific-snapshot@^5.0.0: dependencies: jest-snapshot "^27.0.2" -jest-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" - integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== +jest-util@27.0.6, jest-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.6.tgz#e8e04eec159de2f4d5f57f795df9cdc091e50297" + integrity sha512-1JjlaIh+C65H/F7D11GNkGDDZtDfMEM8EBXsvd+l/cxtgQ6QhxuloOaiayt89DxUvDarbVhqI98HhgrM1yliFQ== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.6" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" - is-ci "^2.0.0" - micromatch "^4.0.2" + is-ci "^3.0.0" + picomatch "^2.2.3" jest-util@^27.0.0, jest-util@^27.0.2: version "27.0.2" @@ -6125,6 +6636,18 @@ jest-validate@^27.0.2: leven "^3.1.0" pretty-format "^27.0.2" +jest-validate@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.6.tgz#930a527c7a951927df269f43b2dc23262457e2a6" + integrity sha512-yhZZOaMH3Zg6DC83n60pLmdU1DQE46DW+KLozPiPbSbPhlXXaiUTDlhHQhHFpaqIFRrInko1FHXjTRpjWRuWfA== + dependencies: + "@jest/types" "^27.0.6" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^27.0.6" + leven "^3.1.0" + pretty-format "^27.0.6" + jest-watcher@^27.0.2: version "27.0.2" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.2.tgz#dab5f9443e2d7f52597186480731a8c6335c5deb" @@ -6147,6 +6670,15 @@ jest-worker@^27.0.2: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" + integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest@^27.0.3: version "27.0.4" resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.4.tgz#91d4d564b36bcf93b98dac1ab19f07089e670f53" @@ -7149,7 +7681,7 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^3.0.0: +normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== @@ -7786,12 +8318,17 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@*, prettier@^2.3.0: +prettier@*: version "2.3.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== -pretty-format@*, pretty-format@^26.0.0, pretty-format@^27.0.0, pretty-format@^27.0.2: +prettier@2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== + +pretty-format@*, pretty-format@^26.0.0, pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.0.6: version "27.0.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.2.tgz#9283ff8c4f581b186b2d4da461617143dca478a4" integrity sha512-mXKbbBPnYTG7Yra9qFBtqj+IXcsvxsvOBco3QHxtxTl+hHKq6QdzMZ+q0CtL4ORHZgwGImRr2XZUX2EWzORxig== @@ -8044,6 +8581,13 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -8207,7 +8751,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.20.0, resolve@^1.3.2: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -9290,10 +9834,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@4.3.2, "typescript@>=3.3.1 <4.4.0", typescript@^4.1.0-dev.20201026, typescript@~4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== +typescript@*, typescript@4.3.5, "typescript@>=3.3.1 <4.4.0", typescript@^4.1.0-dev.20201026, typescript@~4.3.2: + version "4.3.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" @@ -9449,6 +9993,15 @@ v8-to-istanbul@^7.0.0: convert-source-map "^1.6.0" source-map "^0.7.3" +v8-to-istanbul@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" + integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" From 15f718415eb4e522440a5d81f38d65ee81535795 Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 26 Jul 2021 17:03:20 +0000 Subject: [PATCH 04/27] chore: publish v4.28.5 --- CHANGELOG.md | 8 ++++++++ lerna.json | 2 +- packages/ast-spec/CHANGELOG.md | 8 ++++++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-internal/package.json | 4 ++-- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin/package.json | 6 +++--- packages/experimental-utils/CHANGELOG.md | 8 ++++++++ packages/experimental-utils/package.json | 8 ++++---- packages/parser/CHANGELOG.md | 8 ++++++++ packages/parser/package.json | 10 +++++----- packages/scope-manager/CHANGELOG.md | 8 ++++++++ packages/scope-manager/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 8 ++++++++ packages/shared-fixtures/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 8 ++++++++ packages/typescript-estree/package.json | 8 ++++---- packages/visitor-keys/CHANGELOG.md | 8 ++++++++ packages/visitor-keys/package.json | 4 ++-- 24 files changed, 127 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efdec205c75..7cbb536062b 100644 --- a/CHANGELOG.md +++ b/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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/typescript-eslint + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/typescript-eslint diff --git a/lerna.json b/lerna.json index 5fa41e9157c..0bdd3150c5f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "4.28.4", + "version": "4.28.5", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index a290ca85215..cf8aa62fff4 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 e37995c57b9..1de0a2fdbcf 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "4.28.4", + "version": "4.28.5", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 0ee465ed4e9..4ad594f0f09 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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 0ae43a471fc..a66619ad72e 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": "4.28.4", + "version": "4.28.5", "private": true, "main": "dist/index.js", "scripts": { @@ -14,7 +14,7 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "4.28.4", + "@typescript-eslint/experimental-utils": "4.28.5", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 63672ea436b..6bc3be0b84f 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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 61354ebd7f0..3f8f90c5e98 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": "4.28.4", + "version": "4.28.5", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.4", + "@typescript-eslint/experimental-utils": "4.28.5", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "4.28.4" + "@typescript-eslint/parser": "4.28.5" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index ecaff23096b..4409fd54813 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/eslint-plugin diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 551d55df0bd..52d57943096 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "4.28.4", + "version": "4.28.5", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,8 +44,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.4", - "@typescript-eslint/scope-manager": "4.28.4", + "@typescript-eslint/experimental-utils": "4.28.5", + "@typescript-eslint/scope-manager": "4.28.5", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 66f3bc8bbad..754f93ce147 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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 0d8a7d29663..5080e90e0da 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "4.28.4", + "version": "4.28.5", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.28.4", - "@typescript-eslint/types": "4.28.4", - "@typescript-eslint/typescript-estree": "4.28.4", + "@typescript-eslint/scope-manager": "4.28.5", + "@typescript-eslint/types": "4.28.5", + "@typescript-eslint/typescript-estree": "4.28.5", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index b4a7dc14665..83a7fd33fd1 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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index 95368f9fbc7..0c9f9a129e6 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "4.28.4", + "version": "4.28.5", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,14 +44,14 @@ "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "4.28.4", - "@typescript-eslint/types": "4.28.4", - "@typescript-eslint/typescript-estree": "4.28.4", + "@typescript-eslint/scope-manager": "4.28.5", + "@typescript-eslint/types": "4.28.5", + "@typescript-eslint/typescript-estree": "4.28.5", "debug": "^4.3.1" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/experimental-utils": "4.28.4", + "@typescript-eslint/experimental-utils": "4.28.5", "glob": "*", "typescript": "*" }, diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index a7230251837..2c88e35160d 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 5003729ef86..cd220b2e3b3 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "4.28.4", + "version": "4.28.5", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.28.4", - "@typescript-eslint/visitor-keys": "4.28.4" + "@typescript-eslint/types": "4.28.5", + "@typescript-eslint/visitor-keys": "4.28.5" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "4.28.4", + "@typescript-eslint/typescript-estree": "4.28.5", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 7887f29091a..2c4338a53f2 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index e567a7076a0..d9ee72f1db9 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "4.28.4", + "version": "4.28.5", "private": true } diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 5c19f02589c..9abe57bc44b 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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 84897fb773b..c746e3336c4 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "4.28.4", + "version": "4.28.5", "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 8ae4ba83c85..313f0ed9be9 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 a933f4c1d57..00baf7782db 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "4.28.4", + "version": "4.28.5", "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": "4.28.4", - "@typescript-eslint/visitor-keys": "4.28.4", + "@typescript-eslint/types": "4.28.5", + "@typescript-eslint/visitor-keys": "4.28.5", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "4.28.4", + "@typescript-eslint/shared-fixtures": "4.28.5", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index a56f6e2ba29..c147f162a6b 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. +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **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 78e0b1eae1d..e7bacdbc4f5 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "4.28.4", + "version": "4.28.5", "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": "4.28.4", + "@typescript-eslint/types": "4.28.5", "eslint-visitor-keys": "^2.0.0" }, "devDependencies": { From 5e1a61500472ff186eede686b2257464476d3d87 Mon Sep 17 00:00:00 2001 From: Zzzen Date: Sun, 1 Aug 2021 04:39:03 +0800 Subject: [PATCH 05/27] feat(eslint-plugin): [prefer-return-this-type] add a new rule (#3228) --- packages/eslint-plugin/README.md | 1 + .../docs/rules/prefer-return-this-type.md | 90 ++++++ packages/eslint-plugin/src/configs/all.ts | 1 + packages/eslint-plugin/src/rules/index.ts | 2 + .../src/rules/prefer-return-this-type.ts | 178 +++++++++++ packages/eslint-plugin/src/util/astUtils.ts | 36 +++ .../rules/prefer-return-this-type.test.ts | 288 ++++++++++++++++++ 7 files changed, 596 insertions(+) create mode 100644 packages/eslint-plugin/docs/rules/prefer-return-this-type.md create mode 100644 packages/eslint-plugin/src/rules/prefer-return-this-type.ts create mode 100644 packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 344764dcb96..6f890d27256 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -163,6 +163,7 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | | [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | | :wrench: | :thought_balloon: | | [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | :white_check_mark: | :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 | | :wrench: | :thought_balloon: | | [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | | [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Recommends using `@ts-expect-error` over `@ts-ignore` | | :wrench: | | | [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | :wrench: | :thought_balloon: | diff --git a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md new file mode 100644 index 00000000000..161495b82c0 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md @@ -0,0 +1,90 @@ +# Enforce that `this` is used when only `this` type is returned (`prefer-return-this-type`) + +[Method chaining](https://en.wikipedia.org/wiki/Method_chaining) is a common pattern in OOP languages and TypeScript provides a special [polymorphic this type](https://www.typescriptlang.org/docs/handbook/2/classes.html#this-types). +If any type other than `this` is specified as the return type of these chaining methods, TypeScript will fail to cast it when invoking in subclass. + +```ts +class Animal { + eat(): Animal { + console.log("I'm moving!"); + return this; + } +} + +class Cat extends Animal { + meow(): Cat { + console.log('Meow~'); + return this; + } +} + +const cat = new Cat(); +// Error: Property 'meow' does not exist on type 'Animal'. +// because `eat` returns `Animal` and not all animals meow. +cat.eat().meow(); + +// the error can be fixed by removing the return type of `eat` or use `this` as the return type. +class Animal { + eat(): this { + console.log("I'm moving!"); + return this; + } +} + +class Cat extends Animal { + meow(): this { + console.log('Meow~'); + return this; + } +} + +const cat = new Cat(); +// no errors. Because `eat` returns `Cat` now +cat.eat().meow(); +``` + +Examples of **incorrect** code for this rule: + +```ts +class Foo { + f1(): Foo { + return this; + } + f2 = (): Foo => { + return this; + }; + f3(): Foo | undefined { + return Math.random() > 0.5 ? this : undefined; + } +} +``` + +Examples of **correct** code for this rule: + +```ts +class Foo { + f1(): this { + return this; + } + f2() { + return this; + } + f3 = (): this => { + return this; + }; + f4 = () => { + return this; + }; +} + +class Base {} +class Derived extends Base { + f(): Base { + return this; + } +} +``` + +## When Not To Use It + +If you don't use method chaining or explicit return values, you can safely turn this rule off. diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index b21d14efc9f..66209b80623 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -129,6 +129,7 @@ export = { '@typescript-eslint/prefer-readonly-parameter-types': 'error', '@typescript-eslint/prefer-reduce-type-parameter': 'error', '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-return-this-type': 'error', '@typescript-eslint/prefer-string-starts-ends-with': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/promise-function-async': 'error', diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index be78db26f80..1b6fa0f6ea1 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -94,6 +94,7 @@ import preferReadonly from './prefer-readonly'; import preferReadonlyParameterTypes from './prefer-readonly-parameter-types'; import preferReduceTypeParameter from './prefer-reduce-type-parameter'; import preferRegexpExec from './prefer-regexp-exec'; +import preferReturnThisType from './prefer-return-this-type'; import preferStringStartsEndsWith from './prefer-string-starts-ends-with'; import preferTsExpectError from './prefer-ts-expect-error'; import promiseFunctionAsync from './promise-function-async'; @@ -212,6 +213,7 @@ export default { 'prefer-readonly-parameter-types': preferReadonlyParameterTypes, 'prefer-reduce-type-parameter': preferReduceTypeParameter, 'prefer-regexp-exec': preferRegexpExec, + 'prefer-return-this-type': preferReturnThisType, 'prefer-string-starts-ends-with': preferStringStartsEndsWith, 'prefer-ts-expect-error': preferTsExpectError, 'promise-function-async': promiseFunctionAsync, diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts new file mode 100644 index 00000000000..4287d6c5dfa --- /dev/null +++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts @@ -0,0 +1,178 @@ +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import { createRule, forEachReturnStatement, getParserServices } from '../util'; +import * as ts from 'typescript'; + +type ClassLikeDeclaration = + | TSESTree.ClassDeclaration + | TSESTree.ClassExpression; + +type FunctionLike = + | TSESTree.MethodDefinition['value'] + | TSESTree.ArrowFunctionExpression; + +export default createRule({ + name: 'prefer-return-this-type', + defaultOptions: [], + + meta: { + type: 'suggestion', + docs: { + description: + 'Enforce that `this` is used when only `this` type is returned', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + messages: { + useThisType: 'use `this` type instead.', + }, + schema: [], + fixable: 'code', + }, + + create(context) { + const parserServices = getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + + function tryGetNameInType( + name: string, + typeNode: TSESTree.TypeNode, + ): TSESTree.Identifier | undefined { + if ( + typeNode.type === AST_NODE_TYPES.TSTypeReference && + typeNode.typeName.type === AST_NODE_TYPES.Identifier && + typeNode.typeName.name === name + ) { + return typeNode.typeName; + } + + if (typeNode.type === AST_NODE_TYPES.TSUnionType) { + for (const type of typeNode.types) { + const found = tryGetNameInType(name, type); + if (found) { + return found; + } + } + } + + return undefined; + } + + function isThisSpecifiedInParameters(originalFunc: FunctionLike): boolean { + const firstArg = originalFunc.params[0]; + return ( + firstArg && + firstArg.type === AST_NODE_TYPES.Identifier && + firstArg.name === 'this' + ); + } + + function isFunctionReturningThis( + originalFunc: FunctionLike, + originalClass: ClassLikeDeclaration, + ): boolean { + if (isThisSpecifiedInParameters(originalFunc)) { + return false; + } + + const func = parserServices.esTreeNodeToTSNodeMap.get(originalFunc); + + if (!func.body) { + return false; + } + + const classType = checker.getTypeAtLocation( + parserServices.esTreeNodeToTSNodeMap.get(originalClass), + ) as ts.InterfaceType; + + if (func.body.kind !== ts.SyntaxKind.Block) { + const type = checker.getTypeAtLocation(func.body); + return classType.thisType === type; + } + + let hasReturnThis = false; + let hasReturnClassType = false; + + forEachReturnStatement(func.body as ts.Block, stmt => { + const expr = stmt.expression; + if (!expr) { + return; + } + + // fast check + if (expr.kind === ts.SyntaxKind.ThisKeyword) { + hasReturnThis = true; + return; + } + + const type = checker.getTypeAtLocation(expr); + if (classType === type) { + hasReturnClassType = true; + return true; + } + + if (classType.thisType === type) { + hasReturnThis = true; + return; + } + + return; + }); + + return !hasReturnClassType && hasReturnThis; + } + + function checkFunction( + originalFunc: FunctionLike, + originalClass: ClassLikeDeclaration, + ): void { + const className = originalClass.id?.name; + if (!className) { + return; + } + + if (!originalFunc.returnType) { + return; + } + + const classNameRef = tryGetNameInType( + className, + originalFunc.returnType.typeAnnotation, + ); + if (!classNameRef) { + return; + } + + if (isFunctionReturningThis(originalFunc, originalClass)) { + context.report({ + node: classNameRef, + messageId: 'useThisType', + fix(fixer) { + return fixer.replaceText(classNameRef, 'this'); + }, + }); + } + } + + return { + 'ClassBody > MethodDefinition'(node: TSESTree.MethodDefinition): void { + checkFunction(node.value, node.parent!.parent as ClassLikeDeclaration); + }, + 'ClassBody > ClassProperty'(node: TSESTree.ClassProperty): void { + if ( + !( + node.value?.type === AST_NODE_TYPES.FunctionExpression || + node.value?.type === AST_NODE_TYPES.ArrowFunctionExpression + ) + ) { + return; + } + + checkFunction(node.value, node.parent!.parent as ClassLikeDeclaration); + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts index 3fe1c01e296..67bdfca5aa1 100644 --- a/packages/eslint-plugin/src/util/astUtils.ts +++ b/packages/eslint-plugin/src/util/astUtils.ts @@ -1,5 +1,6 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; import { escapeRegExp } from './escapeRegExp'; +import * as ts from 'typescript'; // deeply re-export, for convenience export * from '@typescript-eslint/experimental-utils/dist/ast-utils'; @@ -41,3 +42,38 @@ export function getNameLocationInGlobalDirectiveComment( return { start, end }; } + +// Copied from typescript https://github.com/microsoft/TypeScript/blob/42b0e3c4630c129ca39ce0df9fff5f0d1b4dd348/src/compiler/utilities.ts#L1335 +// Warning: This has the same semantics as the forEach family of functions, +// in that traversal terminates in the event that 'visitor' supplies a truthy value. +export function forEachReturnStatement( + body: ts.Block, + visitor: (stmt: ts.ReturnStatement) => T, +): T | undefined { + return traverse(body); + + function traverse(node: ts.Node): T | undefined { + switch (node.kind) { + case ts.SyntaxKind.ReturnStatement: + return visitor(node); + case ts.SyntaxKind.CaseBlock: + case ts.SyntaxKind.Block: + case ts.SyntaxKind.IfStatement: + case ts.SyntaxKind.DoStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.WithStatement: + case ts.SyntaxKind.SwitchStatement: + case ts.SyntaxKind.CaseClause: + case ts.SyntaxKind.DefaultClause: + case ts.SyntaxKind.LabeledStatement: + case ts.SyntaxKind.TryStatement: + case ts.SyntaxKind.CatchClause: + return ts.forEachChild(node, traverse); + } + + return undefined; + } +} diff --git a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts new file mode 100644 index 00000000000..67864d22b6c --- /dev/null +++ b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts @@ -0,0 +1,288 @@ +import rule from '../../src/rules/prefer-return-this-type'; +import { RuleTester, getFixturesRootDir } from '../RuleTester'; + +const rootPath = getFixturesRootDir(); + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: rootPath, + project: './tsconfig.json', + }, +}); + +ruleTester.run('prefer-return-this-type', rule, { + valid: [ + ` +class Foo { + f1() {} + f2(): Foo { + return new Foo(); + } + f3() { + return this; + } + f4(): this { + return this; + } + f5(): any { + return this; + } + f6(): unknown { + return this; + } + f7(foo: Foo): Foo { + return Math.random() > 0.5 ? foo : this; + } + f10(this: Foo, that: Foo): Foo; + f11(): Foo { + return; + } + f13(this: Foo): Foo { + return this; + } + f14(): { f14: Function } { + return this; + } + f15(): Foo | this { + return Math.random() > 0.5 ? new Foo() : this; + } +} + `, + ` +class Foo { + f1 = () => {}; + f2 = (): Foo => { + return new Foo(); + }; + f3 = () => this; + f4 = (): this => { + return this; + }; + f5 = (): Foo => new Foo(); + f6 = ''; +} + `, + ` +const Foo = class { + bar() { + return this; + } +}; + `, + ` +class Base {} +class Derived extends Base { + f(): Base { + return this; + } +} + `, + ], + invalid: [ + { + code: ` +class Foo { + f(): Foo { + return this; + } +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 8, + }, + ], + output: ` +class Foo { + f(): this { + return this; + } +} + `, + }, + { + code: ` +class Foo { + f(): Foo { + const self = this; + return self; + } +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 8, + }, + ], + output: ` +class Foo { + f(): this { + const self = this; + return self; + } +} + `, + }, + { + code: ` +class Foo { + f = (): Foo => { + return this; + }; +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 11, + }, + ], + output: ` +class Foo { + f = (): this => { + return this; + }; +} + `, + }, + { + code: ` +class Foo { + f = (): Foo => { + const self = this; + return self; + }; +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 11, + }, + ], + output: ` +class Foo { + f = (): this => { + const self = this; + return self; + }; +} + `, + }, + { + code: ` +class Foo { + f = (): Foo => this; +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 11, + }, + ], + output: ` +class Foo { + f = (): this => this; +} + `, + }, + { + code: ` +class Foo { + f1(): Foo | undefined { + return this; + } + f2(): this | undefined { + return this; + } +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 9, + }, + ], + output: ` +class Foo { + f1(): this | undefined { + return this; + } + f2(): this | undefined { + return this; + } +} + `, + }, + { + code: ` +class Foo { + bar(): Foo | undefined { + if (Math.random() > 0.5) { + return this; + } + } +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 10, + }, + ], + output: ` +class Foo { + bar(): this | undefined { + if (Math.random() > 0.5) { + return this; + } + } +} + `, + }, + { + code: ` +class Foo { + bar(num: 1 | 2): Foo { + switch (num) { + case 1: + return this; + case 2: + return this; + } + } +} + `, + errors: [ + { + messageId: 'useThisType', + line: 3, + column: 20, + }, + ], + output: ` +class Foo { + bar(num: 1 | 2): this { + switch (num) { + case 1: + return this; + case 2: + return this; + } + } +} + `, + }, + ], +}); From 6848681a2b702097a7890734b5053f3a9b74ab92 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 31 Jul 2021 14:31:22 -0700 Subject: [PATCH 06/27] test: fix integration tests --- .../fixtures/typescript-and-tslint-plugins-together/test.js.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap index 23e113677cc..cc617dc19cc 100644 --- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap +++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap @@ -4,6 +4,7 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 1, + "fatalErrorCount": 0, "filePath": "/usr/linked/index.ts", "fixableErrorCount": 1, "fixableWarningCount": 0, From 50055ec6b15149d205e74c2cecac9012ebae9a36 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 31 Jul 2021 14:39:24 -0700 Subject: [PATCH 07/27] test: fix more integration test snapshots --- tests/integration/fixtures/eslint-v6/test.js.snap | 1 + tests/integration/fixtures/markdown/test.js.snap | 1 + .../fixtures/recommended-does-not-require-program/test.js.snap | 1 + tests/integration/fixtures/vue-jsx/test.js.snap | 1 + tests/integration/fixtures/vue-sfc/test.js.snap | 3 +++ 5 files changed, 7 insertions(+) diff --git a/tests/integration/fixtures/eslint-v6/test.js.snap b/tests/integration/fixtures/eslint-v6/test.js.snap index 350194ef759..c15f60f0ff9 100644 --- a/tests/integration/fixtures/eslint-v6/test.js.snap +++ b/tests/integration/fixtures/eslint-v6/test.js.snap @@ -4,6 +4,7 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 1, + "fatalErrorCount": 0, "filePath": "/usr/linked/index.ts", "fixableErrorCount": 0, "fixableWarningCount": 0, diff --git a/tests/integration/fixtures/markdown/test.js.snap b/tests/integration/fixtures/markdown/test.js.snap index 8663838f7ed..67725201aa8 100644 --- a/tests/integration/fixtures/markdown/test.js.snap +++ b/tests/integration/fixtures/markdown/test.js.snap @@ -4,6 +4,7 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 10, + "fatalErrorCount": 0, "filePath": "/usr/linked/Doc.md", "fixableErrorCount": 0, "fixableWarningCount": 0, diff --git a/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap b/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap index b313deb408b..5b77306e554 100644 --- a/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap +++ b/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap @@ -4,6 +4,7 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 1, + "fatalErrorCount": 0, "filePath": "/usr/linked/index.ts", "fixableErrorCount": 1, "fixableWarningCount": 0, diff --git a/tests/integration/fixtures/vue-jsx/test.js.snap b/tests/integration/fixtures/vue-jsx/test.js.snap index 3f0b716085b..6877b71a7e8 100644 --- a/tests/integration/fixtures/vue-jsx/test.js.snap +++ b/tests/integration/fixtures/vue-jsx/test.js.snap @@ -4,6 +4,7 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 1, + "fatalErrorCount": 0, "filePath": "/usr/linked/Jsx.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, diff --git a/tests/integration/fixtures/vue-sfc/test.js.snap b/tests/integration/fixtures/vue-sfc/test.js.snap index ac5804574da..3c0d7fc68a3 100644 --- a/tests/integration/fixtures/vue-sfc/test.js.snap +++ b/tests/integration/fixtures/vue-sfc/test.js.snap @@ -4,6 +4,7 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 1, + "fatalErrorCount": 0, "filePath": "/usr/linked/Hello.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, @@ -89,6 +90,7 @@ export default Vue.extend({ }, Object { "errorCount": 0, + "fatalErrorCount": 0, "filePath": "/usr/linked/Utility.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, @@ -114,6 +116,7 @@ export default class Utility { }, Object { "errorCount": 0, + "fatalErrorCount": 0, "filePath": "/usr/linked/World.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, From d48429d97326545bb727f88ce9056270b1599a31 Mon Sep 17 00:00:00 2001 From: Edmundo Santos Date: Sat, 31 Jul 2021 18:41:49 -0300 Subject: [PATCH 08/27] feat(typescript-estree): add support for custom module resolution (#3516) --- packages/parser/README.md | 24 +++++ packages/types/src/parser-options.ts | 1 + packages/typescript-estree/README.md | 5 ++ .../create-program/createDefaultProgram.ts | 8 ++ .../src/create-program/createWatchProgram.ts | 7 ++ .../src/create-program/shared.ts | 20 ++++- .../typescript-estree/src/parser-options.ts | 22 ++++- packages/typescript-estree/src/parser.ts | 5 ++ .../tests/fixtures/moduleResolver/file.ts | 0 .../fixtures/moduleResolver/moduleResolver.js | 36 ++++++++ .../fixtures/moduleResolver/something.ts | 1 + .../tsconfig.defaultProgram.json | 3 + .../fixtures/moduleResolver/tsconfig.json | 3 + .../typescript-estree/tests/lib/parse.test.ts | 90 +++++++++++++++++++ 14 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/moduleResolver/file.ts create mode 100644 packages/typescript-estree/tests/fixtures/moduleResolver/moduleResolver.js create mode 100644 packages/typescript-estree/tests/fixtures/moduleResolver/something.ts create mode 100644 packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.defaultProgram.json create mode 100644 packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json diff --git a/packages/parser/README.md b/packages/parser/README.md index 04f5c53d0f4..70ca5bf63d6 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -66,6 +66,7 @@ interface ParserOptions { warnOnUnsupportedTypeScriptVersion?: boolean; program?: import('typescript').Program; + moduleResolver?: string; } ``` @@ -221,6 +222,29 @@ This option allows you to programmatically provide an array of one or more insta This will override any programs that would have been computed from `parserOptions.project` or `parserOptions.createDefaultProgram`. All linted files must be part of the provided program(s). +### `parserOptions.moduleResolver` + +Default `undefined`. + +This option allows you to provide a custom module resolution. The value should point to a JS file that default exports (`export default`, or `module.exports =`, or `export =`) a file with the following interface: + +```ts +interface ModuleResolver { + version: 1; + resolveModuleNames( + moduleNames: string[], + containingFile: string, + reusedNames: string[] | undefined, + redirectedReference: ts.ResolvedProjectReference | undefined, + options: ts.CompilerOptions, + ): (ts.ResolvedModule | undefined)[]; +} +``` + +[Refer to the TypeScript Wiki for an example on how to write the `resolveModuleNames` function](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#customizing-module-resolution). + +Note that if you pass custom programs via `options.programs` this option will not have any effect over them (you can simply add the custom resolution on them directly). + ## Utilities ### `createProgram(configFile, projectDirectory)` diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index a8ecb896726..850086e1c5b 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -51,6 +51,7 @@ interface ParserOptions { tsconfigRootDir?: string; useJSXTextNode?: boolean; warnOnUnsupportedTypeScriptVersion?: boolean; + moduleResolver?: string; } export { DebugLevel, EcmaVersion, ParserOptions, SourceType }; diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 31084150646..9cbcb2727cf 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -239,6 +239,11 @@ interface ParseAndGenerateServicesOptions extends ParseOptions { * whether or not ESLint is being used as part of a single run. */ allowAutomaticSingleRunInference?: boolean; + + /** + * Path to a file exporting a custom ModuleResolver. + */ + moduleResolver?: string; } interface ParserServices { diff --git a/packages/typescript-estree/src/create-program/createDefaultProgram.ts b/packages/typescript-estree/src/create-program/createDefaultProgram.ts index c912a44418a..6e8c2161250 100644 --- a/packages/typescript-estree/src/create-program/createDefaultProgram.ts +++ b/packages/typescript-estree/src/create-program/createDefaultProgram.ts @@ -6,6 +6,7 @@ import { ASTAndProgram, CanonicalPath, createDefaultCompilerOptionsFromExtra, + getModuleResolver, } from './shared'; const log = debug('typescript-eslint:typescript-estree:createDefaultProgram'); @@ -43,6 +44,13 @@ function createDefaultProgram( commandLine.options, /* setParentNodes */ true, ); + + if (extra.moduleResolver) { + compilerHost.resolveModuleNames = getModuleResolver( + extra.moduleResolver, + ).resolveModuleNames; + } + const oldReadFile = compilerHost.readFile; compilerHost.readFile = (fileName: string): string | undefined => path.normalize(fileName) === path.normalize(extra.filePath) diff --git a/packages/typescript-estree/src/create-program/createWatchProgram.ts b/packages/typescript-estree/src/create-program/createWatchProgram.ts index f10f2a2295f..2142065e47b 100644 --- a/packages/typescript-estree/src/create-program/createWatchProgram.ts +++ b/packages/typescript-estree/src/create-program/createWatchProgram.ts @@ -9,6 +9,7 @@ import { CanonicalPath, createDefaultCompilerOptionsFromExtra, getCanonicalFileName, + getModuleResolver, } from './shared'; const log = debug('typescript-eslint:typescript-estree:createWatchProgram'); @@ -269,6 +270,12 @@ function createWatchProgram( /*reportWatchStatus*/ () => {}, ) as WatchCompilerHostOfConfigFile; + if (extra.moduleResolver) { + watchCompilerHost.resolveModuleNames = getModuleResolver( + extra.moduleResolver, + ).resolveModuleNames; + } + // ensure readFile reads the code being linted instead of the copy on disk const oldReadFile = watchCompilerHost.readFile; watchCompilerHost.readFile = (filePathIn, encoding): string | undefined => { diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index 8202c538d34..a0e654c9097 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -1,7 +1,7 @@ import path from 'path'; import * as ts from 'typescript'; import { Program } from 'typescript'; -import { Extra } from '../parser-options'; +import { Extra, ModuleResolver } from '../parser-options'; interface ASTAndProgram { ast: ts.SourceFile; @@ -124,6 +124,23 @@ function getAstFromProgram( return ast && { ast, program: currentProgram }; } +function getModuleResolver(moduleResolverPath: string): ModuleResolver { + let moduleResolver: ModuleResolver; + + try { + moduleResolver = require(moduleResolverPath) as ModuleResolver; + } catch (error) { + const errorLines = [ + 'Could not find the provided parserOptions.moduleResolver.', + 'Hint: use an absolute path if you are not in control over where the ESLint instance runs.', + ]; + + throw new Error(errorLines.join('\n')); + } + + return moduleResolver; +} + export { ASTAndProgram, CORE_COMPILER_OPTIONS, @@ -134,4 +151,5 @@ export { getCanonicalFileName, getScriptKind, getAstFromProgram, + getModuleResolver, }; diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 0bde1d9176a..55f47ef9041 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -1,5 +1,5 @@ import { DebugLevel } from '@typescript-eslint/types'; -import type { Program } from 'typescript'; +import * as ts from 'typescript'; import { CanonicalPath } from './create-program/shared'; import { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree'; @@ -21,13 +21,14 @@ export interface Extra { singleRun: boolean; log: (message: string) => void; preserveNodeMaps?: boolean; - programs: null | Iterable; + programs: null | Iterable; projects: CanonicalPath[]; range: boolean; strict: boolean; tokens: null | TSESTree.Token[]; tsconfigRootDir: string; useJSXTextNode: boolean; + moduleResolver: string; } //////////////////////////////////////////////////// @@ -176,7 +177,7 @@ interface ParseAndGenerateServicesOptions extends ParseOptions { * This overrides any program or programs that would have been computed from the `project` option. * All linted files must be part of the provided program(s). */ - programs?: Program[]; + programs?: ts.Program[]; /** *************************************************************************************** @@ -202,6 +203,8 @@ interface ParseAndGenerateServicesOptions extends ParseOptions { * whether or not ESLint is being used as part of a single run. */ allowAutomaticSingleRunInference?: boolean; + + moduleResolver?: string; } export type TSESTreeOptions = ParseAndGenerateServicesOptions; @@ -221,8 +224,19 @@ export interface ParserWeakMapESTreeToTSNode< } export interface ParserServices { - program: Program; + program: ts.Program; esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode; tsNodeToESTreeNodeMap: ParserWeakMap; hasFullTypeInformation: boolean; } + +export interface ModuleResolver { + version: 1; + resolveModuleNames( + moduleNames: string[], + containingFile: string, + reusedNames: string[] | undefined, + redirectedReference: ts.ResolvedProjectReference | undefined, + options: ts.CompilerOptions, + ): (ts.ResolvedModule | undefined)[]; +} diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 904bb054fdf..3701a8862b3 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -135,6 +135,7 @@ function resetExtra(): void { * of a long-running session (e.g. in an IDE) and watch programs will therefore be required */ singleRun: false, + moduleResolver: '', }; } @@ -342,6 +343,10 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { extra.EXPERIMENTAL_useSourceOfProjectReferenceRedirect = typeof options.EXPERIMENTAL_useSourceOfProjectReferenceRedirect === 'boolean' && options.EXPERIMENTAL_useSourceOfProjectReferenceRedirect; + + if (typeof options.moduleResolver === 'string') { + extra.moduleResolver = options.moduleResolver; + } } function warnAboutTSVersion(): void { diff --git a/packages/typescript-estree/tests/fixtures/moduleResolver/file.ts b/packages/typescript-estree/tests/fixtures/moduleResolver/file.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/typescript-estree/tests/fixtures/moduleResolver/moduleResolver.js b/packages/typescript-estree/tests/fixtures/moduleResolver/moduleResolver.js new file mode 100644 index 00000000000..112df1b4b5f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/moduleResolver/moduleResolver.js @@ -0,0 +1,36 @@ +const ts = require('typescript'); + +module.exports = { + version: 1, + resolveModuleNames: ( + moduleNames, + containingFile, + _reusedNames, + _redirectedReferences, + compilerOptions, + ) => { + const resolvedModules = []; + + for (const moduleName of moduleNames) { + let parsedModuleName = moduleName; + + if (parsedModuleName === '__PLACEHOLDER__') { + parsedModuleName = './something'; + } + + const resolution = ts.resolveModuleName( + parsedModuleName, + containingFile, + compilerOptions, + { + fileExists: ts.sys.fileExists, + readFile: ts.sys.readFile, + }, + ); + + resolvedModules.push(resolution.resolvedModule); + } + + return resolvedModules; + } +} diff --git a/packages/typescript-estree/tests/fixtures/moduleResolver/something.ts b/packages/typescript-estree/tests/fixtures/moduleResolver/something.ts new file mode 100644 index 00000000000..c069798b6c2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/moduleResolver/something.ts @@ -0,0 +1 @@ +export const something = () => true; diff --git a/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.defaultProgram.json b/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.defaultProgram.json new file mode 100644 index 00000000000..8de5ab30398 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.defaultProgram.json @@ -0,0 +1,3 @@ +{ + "include": [] +} diff --git a/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json b/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json new file mode 100644 index 00000000000..e7f769a1841 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json @@ -0,0 +1,3 @@ +{ + "include": ["./file.ts", "./something.ts"] +} diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts index 3e312973700..aa15fc136c1 100644 --- a/packages/typescript-estree/tests/lib/parse.test.ts +++ b/packages/typescript-estree/tests/lib/parse.test.ts @@ -670,4 +670,94 @@ describe('parseAndGenerateServices', () => { expect(testParse('includeme', ignore)).not.toThrow(); }); }); + + describe('moduleResolver', () => { + beforeEach(() => { + parser.clearCaches(); + }); + + const PROJECT_DIR = resolve(FIXTURES_DIR, '../moduleResolver'); + const code = ` + import { something } from '__PLACEHOLDER__'; + + something(); + `; + const config: TSESTreeOptions = { + comment: true, + tokens: true, + range: true, + loc: true, + project: './tsconfig.json', + tsconfigRootDir: PROJECT_DIR, + filePath: resolve(PROJECT_DIR, 'file.ts'), + }; + const withDefaultProgramConfig: TSESTreeOptions = { + ...config, + project: './tsconfig.defaultProgram.json', + createDefaultProgram: true, + }; + + describe('when file is in the project', () => { + it('returns error if __PLACEHOLDER__ can not be resolved', () => { + expect( + parser + .parseAndGenerateServices(code, config) + .services.program.getSemanticDiagnostics(), + ).toHaveProperty( + [0, 'messageText'], + "Cannot find module '__PLACEHOLDER__' or its corresponding type declarations.", + ); + }); + + it('throws error if moduleResolver can not be found', () => { + expect(() => + parser.parseAndGenerateServices(code, { + ...config, + moduleResolver: resolve( + PROJECT_DIR, + './this_moduleResolver_does_not_exist.js', + ), + }), + ).toThrowErrorMatchingInlineSnapshot(` + "Could not find the provided parserOptions.moduleResolver. + Hint: use an absolute path if you are not in control over where the ESLint instance runs." + `); + }); + + it('resolves __PLACEHOLDER__ correctly', () => { + expect( + parser + .parseAndGenerateServices(code, { + ...config, + moduleResolver: resolve(PROJECT_DIR, './moduleResolver.js'), + }) + .services.program.getSemanticDiagnostics(), + ).toHaveLength(0); + }); + }); + + describe('when file is not in the project and createDefaultProgram=true', () => { + it('returns error because __PLACEHOLDER__ can not be resolved', () => { + expect( + parser + .parseAndGenerateServices(code, withDefaultProgramConfig) + .services.program.getSemanticDiagnostics(), + ).toHaveProperty( + [0, 'messageText'], + "Cannot find module '__PLACEHOLDER__' or its corresponding type declarations.", + ); + }); + + it('resolves __PLACEHOLDER__ correctly', () => { + expect( + parser + .parseAndGenerateServices(code, { + ...withDefaultProgramConfig, + moduleResolver: resolve(PROJECT_DIR, './moduleResolver.js'), + }) + .services.program.getSemanticDiagnostics(), + ).toHaveLength(0); + }); + }); + }); }); From 418ab6951d269f2fd18fd79d1803506eb6294bf0 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 31 Jul 2021 15:08:51 -0700 Subject: [PATCH 09/27] test: fix integration test snapshots --- tests/integration/fixtures/eslint-v6/test.js.snap | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/fixtures/eslint-v6/test.js.snap b/tests/integration/fixtures/eslint-v6/test.js.snap index c15f60f0ff9..350194ef759 100644 --- a/tests/integration/fixtures/eslint-v6/test.js.snap +++ b/tests/integration/fixtures/eslint-v6/test.js.snap @@ -4,7 +4,6 @@ exports[`it should produce the expected lint ouput 1`] = ` Array [ Object { "errorCount": 1, - "fatalErrorCount": 0, "filePath": "/usr/linked/index.ts", "fixableErrorCount": 0, "fixableWarningCount": 0, From ce984e3b94093617f4500cd30c38c15efa1e91d1 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 31 Jul 2021 19:08:07 -0400 Subject: [PATCH 10/27] chore: enable no-unsafe-return internally (#3471) --- .eslintrc.js | 3 ++- packages/eslint-plugin/src/rules/no-loss-of-precision.ts | 4 +++- packages/eslint-plugin/tools/generate-rules-lists.ts | 2 +- packages/scope-manager/tests/util/serializers/TSESTreeNode.ts | 2 +- packages/typescript-estree/src/convert.ts | 2 +- tools/generate-contributors.ts | 4 ++-- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b39e5187bc7..e03f3106c93 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -66,7 +66,6 @@ module.exports = { // TODO - enable these new recommended rules '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/restrict-template-expressions': 'off', // TODO - enable this '@typescript-eslint/naming-convention': 'off', @@ -173,6 +172,7 @@ module.exports = { }, rules: { '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-return': 'off', 'eslint-plugin/no-identical-tests': 'error', 'jest/no-disabled-tests': 'warn', 'jest/no-focused-tests': 'error', @@ -198,6 +198,7 @@ module.exports = { rules: { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/restrict-plus-operands': 'off', }, }, diff --git a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts index f6b15c0430c..e9d52852668 100644 --- a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts +++ b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts @@ -4,7 +4,9 @@ import * as util from '../util'; const baseRule = ((): typeof BaseRule | null => { try { - return require('eslint/lib/rules/no-loss-of-precision'); + return require('eslint/lib/rules/no-loss-of-precision') as + | typeof BaseRule + | null; } catch { /* istanbul ignore next */ return null; diff --git a/packages/eslint-plugin/tools/generate-rules-lists.ts b/packages/eslint-plugin/tools/generate-rules-lists.ts index 65faf6f2aa2..a4d3f3af8e7 100644 --- a/packages/eslint-plugin/tools/generate-rules-lists.ts +++ b/packages/eslint-plugin/tools/generate-rules-lists.ts @@ -43,7 +43,7 @@ const staticElements = { emojiKey.fixable, emojiKey.requiresTypeChecking, ], - listSpacerRow: Array(5).fill('-'), + listSpacerRow: Array(5).fill('-'), }; const returnEmojiIfTrue = ( diff --git a/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts b/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts index 4611ddcce73..3d57ab11d73 100644 --- a/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts +++ b/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts @@ -18,7 +18,7 @@ const SEEN_NODES = new Map(); const serializer: NewPlugin = { test(val): boolean { - return ( + return !!( val && typeof val === 'object' && // make sure it's not one of the classes from the package diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 8ffa10ab918..567da9d88ca 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,5 +1,5 @@ // There's lots of funny stuff due to the typing of ts.Node -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return */ import * as ts from 'typescript'; import { canContainDirective, diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts index 07d59c394f0..c668ecf3da4 100644 --- a/tools/generate-contributors.ts +++ b/tools/generate-contributors.ts @@ -78,9 +78,9 @@ async function main(): Promise { // fetch the user info const users = await Promise.all( - githubContributors.map>(async c => { + githubContributors.map(async c => { const response = await fetch(c.url, { method: 'GET' }); - return response.json(); + return (await response.json()) as User; }), ); From 120d566c980c61d3823fbe8b2db30d76b8c31140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 1 Aug 2021 01:14:35 +0200 Subject: [PATCH 11/27] feat(ast-spec): extract `ExportKind` & `ImportKind` (#3564) --- .../ast-spec/src/declaration/ExportAllDeclaration/spec.ts | 3 ++- packages/ast-spec/src/declaration/ExportAndImportKind.ts | 4 ++++ .../ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts | 3 ++- .../ast-spec/src/declaration/ExportNamedDeclaration/spec.ts | 3 ++- packages/ast-spec/src/declaration/ImportDeclaration/spec.ts | 3 ++- .../src/declaration/TSImportEqualsDeclaration/spec.ts | 3 ++- 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 packages/ast-spec/src/declaration/ExportAndImportKind.ts diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts index e9657a7536f..e6700070b59 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts @@ -2,10 +2,11 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { Identifier } from '../../expression/Identifier/spec'; import type { Expression } from '../../unions/Expression'; +import type { ExportKind } from '../ExportAndImportKind'; export interface ExportAllDeclaration extends BaseNode { type: AST_NODE_TYPES.ExportAllDeclaration; source: Expression | null; - exportKind: 'type' | 'value'; + exportKind: ExportKind; exported: Identifier | null; } diff --git a/packages/ast-spec/src/declaration/ExportAndImportKind.ts b/packages/ast-spec/src/declaration/ExportAndImportKind.ts new file mode 100644 index 00000000000..e8d90b76798 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAndImportKind.ts @@ -0,0 +1,4 @@ +type ExportAndImportKind = 'type' | 'value'; + +export type ExportKind = ExportAndImportKind; +export type ImportKind = ExportAndImportKind; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts index f34b6e44668..492d0981b8c 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts @@ -2,9 +2,10 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { ExportDeclaration } from '../../unions/ExportDeclaration'; import type { Expression } from '../../unions/Expression'; +import type { ExportKind } from '../ExportAndImportKind'; export interface ExportDefaultDeclaration extends BaseNode { type: AST_NODE_TYPES.ExportDefaultDeclaration; declaration: ExportDeclaration | Expression; - exportKind: 'type' | 'value'; + exportKind: ExportKind; } diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts index 021fea1c633..bf4d9ea86d2 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts @@ -3,11 +3,12 @@ import type { BaseNode } from '../../base/BaseNode'; import type { ExportSpecifier } from '../../special/ExportSpecifier/spec'; import type { ExportDeclaration } from '../../unions/ExportDeclaration'; import type { Expression } from '../../unions/Expression'; +import type { ExportKind } from '../ExportAndImportKind'; export interface ExportNamedDeclaration extends BaseNode { type: AST_NODE_TYPES.ExportNamedDeclaration; declaration: ExportDeclaration | null; specifiers: ExportSpecifier[]; source: Expression | null; - exportKind: 'type' | 'value'; + exportKind: ExportKind; } diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts b/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts index eaaad5f53e3..2aeaeae4539 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts @@ -2,10 +2,11 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { ImportClause } from '../../unions/ImportClause'; import type { Literal } from '../../unions/Literal'; +import type { ImportKind } from '../ExportAndImportKind'; export interface ImportDeclaration extends BaseNode { type: AST_NODE_TYPES.ImportDeclaration; source: Literal; specifiers: ImportClause[]; - importKind: 'type' | 'value'; + importKind: ImportKind; } diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts index 4c434dded78..5ccd9b6fc4f 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts @@ -3,11 +3,12 @@ import type { BaseNode } from '../../base/BaseNode'; import type { Identifier } from '../../expression/Identifier/spec'; import type { TSExternalModuleReference } from '../../special/TSExternalModuleReference/spec'; import type { EntityName } from '../../unions/EntityName'; +import type { ImportKind } from '../ExportAndImportKind'; export interface TSImportEqualsDeclaration extends BaseNode { type: AST_NODE_TYPES.TSImportEqualsDeclaration; id: Identifier; moduleReference: EntityName | TSExternalModuleReference; - importKind: 'type' | 'value'; + importKind: ImportKind; isExport: boolean; } From 72d53e447c9f4851b20bda20616aa9f9c26c7d53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 31 Jul 2021 16:14:58 -0700 Subject: [PATCH 12/27] chore: bump cspell from 5.6.4 to 5.6.6 (#3566) Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 5.6.4 to 5.6.6. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v5.6.4...v5.6.6) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9810d184e89..2133d098ab8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -460,10 +460,10 @@ dependencies: chalk "^4.0.0" -"@cspell/cspell-bundled-dicts@^5.6.4": - version "5.6.4" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.6.4.tgz#09809441105711f545ef64950fb8ae7cb50c97cc" - integrity sha512-0Q7byfMiLpUocALf8WWoQgYJpCY2fOyoH20AF1lhzPhHkoNXw0G0TisBIqinLI/c5sLsOFrZtH+kD1+cgF/b1A== +"@cspell/cspell-bundled-dicts@^5.6.6": + version "5.6.6" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.6.6.tgz#17ed23657d4a67fa8e60dacf40bfdff402009dd0" + integrity sha512-am79SwDYrs0g1aLmtoZDWIj/IT070ISPoZabpTqnR58MFn0NGrLlF9yEKy3oVZtJhe10L3WWHreYZkdELLS9Sg== dependencies: "@cspell/dict-ada" "^1.1.2" "@cspell/dict-aws" "^1.0.14" @@ -500,10 +500,10 @@ "@cspell/dict-software-terms" "^1.0.37" "@cspell/dict-typescript" "^1.0.19" -"@cspell/cspell-types@^5.6.4": - version "5.6.4" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.6.4.tgz#c49c5a0196e4c95d151ce7147679251df757ae19" - integrity sha512-7XoM1lakuwEJmKjXcZlqAgY1wzamrJGtKP8ZM9RzHYTfYoP/bJ8APViwVsQFpG1YyZ5K83F+vdvDkKjlRk1ZpA== +"@cspell/cspell-types@^5.6.5": + version "5.6.5" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.6.5.tgz#445e73616e60ea27314595cedd8979dd8cae1091" + integrity sha512-NCcMIelcQFwr2Yu9ma0buVBAFBlqtlxvAurV5UYmdaYyFv6bKO81HN9oMpu5DFev0ntOjZUSYdAGAhCUuikd3w== "@cspell/dict-ada@^1.1.2": version "1.1.2" @@ -3624,35 +3624,35 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -cspell-glob@^5.6.4: - version "5.6.4" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.6.4.tgz#282810958f253c665e052df70b8d6fc9b14e5bb7" - integrity sha512-aSXLEOPGYAy/b97NNqw0jyB3T/JTwFtoh2n5lWisUHhqOufpcPnVbbZmX8UWIwFPs6fD4M0oFyhUCAMDg9sfhQ== +cspell-glob@^5.6.5: + version "5.6.5" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.6.5.tgz#125818f94903fb070b9bb0f9fdf2488d2a279db7" + integrity sha512-bobER7IoYBJZCXxkiAc5FT1Tb55TFLf1vZSw0ORCFYMeMHlvYktwDx0Wo6/Nkz39MtMQ9nvLrepCMEEZNpKhVw== dependencies: micromatch "^4.0.4" -cspell-io@^5.6.4: - version "5.6.4" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.6.4.tgz#ce282d15c61eb631156cc92eed067362915de834" - integrity sha512-N0jgFupRsVNKt/UXx3HwGeOQJU7W+IfIKoBP0PIZuJe7MsuT+YofpQYwLcNxEQ7n5sOqRlPvS/6qRL8epClGPw== +cspell-io@^5.6.5: + version "5.6.5" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.6.5.tgz#071dfb9c1d1e38c758d9a5b38d5690142fb2e64f" + integrity sha512-OcnuiOkOetcWtihBF57fefLTNPHgsNEc7+x04U7hto3lwEWe8CFQfnkLbQIZfzXOyiyuPY2yjDO0/Y3oqWrB3A== dependencies: iconv-lite "^0.6.3" iterable-to-stream "^2.0.0" -cspell-lib@^5.6.4: - version "5.6.4" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.6.4.tgz#fd19b8bc5ac54d394aa76075697ad3b62c000fe6" - integrity sha512-54esfuMa+DTyvrRgsoo30E9u/sHH5QEB0yyQ5LeyzlxlTmaUq5kTE/gssH9jkwXt1gd4rmb8jfE55Y+tQkXWWg== +cspell-lib@^5.6.6: + version "5.6.6" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.6.6.tgz#241924d83d9df9714692946246afe37c9074a79b" + integrity sha512-Sum4U7/xWTJm99DeZF0bFBBN5SQ7roArlwnnKMmuRRcYl3s9/3OgtIK2YOOgqoSCxh4G51f7aal+bNAlAnx1bA== dependencies: - "@cspell/cspell-bundled-dicts" "^5.6.4" - "@cspell/cspell-types" "^5.6.4" + "@cspell/cspell-bundled-dicts" "^5.6.6" + "@cspell/cspell-types" "^5.6.5" clear-module "^4.1.1" comment-json "^4.1.0" configstore "^5.0.1" cosmiconfig "^7.0.0" - cspell-glob "^5.6.4" - cspell-io "^5.6.4" - cspell-trie-lib "^5.6.4" + cspell-glob "^5.6.5" + cspell-io "^5.6.5" + cspell-trie-lib "^5.6.5" find-up "^5.0.0" fs-extra "^10.0.0" gensequence "^3.1.1" @@ -3661,25 +3661,25 @@ cspell-lib@^5.6.4: resolve-global "^1.0.0" vscode-uri "^3.0.2" -cspell-trie-lib@^5.6.4: - version "5.6.4" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.6.4.tgz#e737e842a05f6130141eb53e45802294db257dd3" - integrity sha512-5BFPqkRUZLk1OCUyHExUmHQTnrie4z1TMwXRk0Ur4nE7pZ90Mu7YrPnujyXt9RAo1Wh8REhTlQoZpN60wOrBJQ== +cspell-trie-lib@^5.6.5: + version "5.6.5" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.6.5.tgz#f0bbb998f62fd2122e1ab10a34ffd1bce9c03ab7" + integrity sha512-x4Ii8LwFp7tt+Ie+5R/a/qgYn43R5RwRfByn3taMy4D++PgF+vHTVZm1yORmUFBPTIT39gFbtkAJR7X0kdBL/w== dependencies: fs-extra "^10.0.0" gensequence "^3.1.1" cspell@^5.5.2: - version "5.6.4" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.6.4.tgz#572fc72669c5a4cad68553b6f8943f30060c2b52" - integrity sha512-pdOvCv5Cn3mN+NPk10hZDI8Y8TDqZq//9lMC9r31xJJCqcUvWHz0FLbiEzqBbUwQJJ2KaCDUcOybZAsaRiY27w== + version "5.6.6" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.6.6.tgz#b9af8535b1c5e0ec856d17c98e4b04128feca78b" + integrity sha512-4k3Jcz61mv5SQNjVcrWjARcEVa7gOF8nyg5MPU68AWPoyg5VuE51jgQDr4c01dbG/PGRLtrLwVmr+r6Kh5RDVA== dependencies: - "@cspell/cspell-types" "^5.6.4" + "@cspell/cspell-types" "^5.6.5" chalk "^4.1.1" commander "^7.2.0" comment-json "^4.1.0" - cspell-glob "^5.6.4" - cspell-lib "^5.6.4" + cspell-glob "^5.6.5" + cspell-lib "^5.6.6" fs-extra "^10.0.0" get-stdin "^8.0.0" glob "^7.1.7" From b362620ba248fde279aef98989aaecd243ba9d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 1 Aug 2021 01:17:54 +0200 Subject: [PATCH 13/27] refactor(experimental-utils): simplify `eslint-utils`' predicate types in `ast-utils` even more (#3569) --- .../src/ast-utils/eslint-utils/predicates.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts index 290afca90eb..ad89e4730fc 100644 --- a/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts +++ b/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts @@ -1,16 +1,20 @@ import * as eslintUtils from 'eslint-utils'; import { TSESTree } from '../../ts-estree'; -type IsPunctuatorTokenWithValueFunction = ( +type IsSpecificTokenFunction = ( token: TSESTree.Token, -) => token is TSESTree.PunctuatorToken & { value: Value }; +) => token is SpecificToken; -type IsNotPunctuatorTokenWithValueFunction = ( +type IsNotSpecificTokenFunction = ( token: TSESTree.Token, -) => token is Exclude< - TSESTree.Token, - TSESTree.PunctuatorToken & { value: Value } ->; +) => token is Exclude; + +type PunctuatorTokenWithValue = + TSESTree.PunctuatorToken & { value: Value }; +type IsPunctuatorTokenWithValueFunction = + IsSpecificTokenFunction>; +type IsNotPunctuatorTokenWithValueFunction = + IsNotSpecificTokenFunction>; const isArrowToken = eslintUtils.isArrowToken as IsPunctuatorTokenWithValueFunction<'=>'>; @@ -42,12 +46,10 @@ const isCommaToken = const isNotCommaToken = eslintUtils.isNotCommaToken as IsNotPunctuatorTokenWithValueFunction<','>; -const isCommentToken = eslintUtils.isCommentToken as ( - token: TSESTree.Token, -) => token is TSESTree.Comment; -const isNotCommentToken = eslintUtils.isNotCommentToken as ( - token: TSESTree.Token, -) => token is Exclude; +const isCommentToken = + eslintUtils.isCommentToken as IsSpecificTokenFunction; +const isNotCommentToken = + eslintUtils.isNotCommentToken as IsNotSpecificTokenFunction; const isOpeningBraceToken = eslintUtils.isOpeningBraceToken as IsPunctuatorTokenWithValueFunction<'{'>; From 3ef5267b850e1ffb7115e263e89a98c455fd2532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 1 Aug 2021 01:19:22 +0200 Subject: [PATCH 14/27] fix(experimental-utils): simplify `eslint-utils`' `findVariable`'s signature in `ast-utils` (#3574) --- .../src/ast-utils/eslint-utils/scopeAnalysis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts b/packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts index 15f9325a582..fa3efc70a77 100644 --- a/packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts +++ b/packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts @@ -9,7 +9,7 @@ import * as TSESLint from '../../ts-eslint'; */ const findVariable = eslintUtils.findVariable as ( initialScope: TSESLint.Scope.Scope, - name: string, + nameOrNode: string | TSESTree.Identifier, ) => TSESLint.Scope.Variable | null; /** From 18e30cb601ee4e990d6becdfb9d98ae8119b7919 Mon Sep 17 00:00:00 2001 From: Idan Attias Date: Sun, 1 Aug 2021 02:25:01 +0300 Subject: [PATCH 15/27] feat(eslint-plugin): [no-redeclare] ignoreDeclarationMerge of enum+namespace (#3572) --- .../eslint-plugin/docs/rules/no-redeclare.md | 1 + .../eslint-plugin/src/rules/no-redeclare.ts | 27 ++++++++++++++++++- .../tests/rules/no-redeclare.test.ts | 24 +++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md index 4b5164d6f0e..539e691cfb2 100644 --- a/packages/eslint-plugin/docs/rules/no-redeclare.md +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -41,6 +41,7 @@ When set to `true`, the rule will ignore declaration merges between the followin - class + namespace - class + interface + namespace - function + namespace +- enum + namespace Examples of **correct** code with `{ ignoreDeclarationMerge: true }`: diff --git a/packages/eslint-plugin/src/rules/no-redeclare.ts b/packages/eslint-plugin/src/rules/no-redeclare.ts index 399966b16d2..ae4b2e9a3f5 100644 --- a/packages/eslint-plugin/src/rules/no-redeclare.ts +++ b/packages/eslint-plugin/src/rules/no-redeclare.ts @@ -63,6 +63,10 @@ export default util.createRule({ AST_NODE_TYPES.TSModuleDeclaration, AST_NODE_TYPES.FunctionDeclaration, ]); + const ENUM_DECLARATION_MERGE_NODES = new Set([ + AST_NODE_TYPES.TSEnumDeclaration, + AST_NODE_TYPES.TSModuleDeclaration, + ]); function* iterateDeclarations(variable: TSESLint.Scope.Variable): Generator< { @@ -164,12 +168,33 @@ export default util.createRule({ return; } - // there's more than one class declaration, which needs to be reported + // there's more than one function declaration, which needs to be reported for (const { identifier } of functionDecls) { yield { type: 'syntax', node: identifier, loc: identifier.loc }; } return; } + + if ( + // enum + namespace merging + identifiers.every(({ parent }) => + ENUM_DECLARATION_MERGE_NODES.has(parent.type), + ) + ) { + const enumDecls = identifiers.filter( + ({ parent }) => parent.type === AST_NODE_TYPES.TSEnumDeclaration, + ); + if (enumDecls.length === 1) { + // safe declaration merging + return; + } + + // there's more than one enum declaration, which needs to be reported + for (const { identifier } of enumDecls) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + return; + } } for (const { identifier } of identifiers) { diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts index f227c5ac891..c371a738755 100644 --- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -122,6 +122,13 @@ namespace A {} code: ` interface A {} class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: true }], + }, + { + code: ` +enum A {} namespace A {} `, options: [{ ignoreDeclarationMerge: true }], @@ -605,6 +612,23 @@ class A {} }, { code: ` +enum A {} +namespace A {} +enum A {} + `, + options: [{ ignoreDeclarationMerge: true }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 4, + }, + ], + }, + { + code: ` function A() {} class A {} namespace A {} From b595575ccef7bceb04c6317fb903f4bedeb19a69 Mon Sep 17 00:00:00 2001 From: alonstern Date: Sun, 1 Aug 2021 02:28:27 +0300 Subject: [PATCH 16/27] fix(eslint-plugin): [no-unnecessary-boolean-literal-compare] incorrect fix when condition is reversed (#3581) --- .../no-unnecessary-boolean-literal-compare.ts | 2 +- ...nnecessary-boolean-literal-compare.test.ts | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index fe1fd24cc4f..55719d857da 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -186,7 +186,7 @@ export default util.createRule({ range: expression.range[0] < against.range[0] ? [expression.range[1], against.range[1]] - : [against.range[1], expression.range[1]], + : [against.range[0], expression.range[0]], }; } diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts index 36eb36033de..7896fe00de8 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts @@ -224,5 +224,39 @@ ruleTester.run('no-unnecessary-boolean-literal-compare', rule, { } `, }, + { + code: ` + declare const varBoolean: boolean; + if (false !== varBoolean) { + } + `, + errors: [ + { + messageId: 'negated', + }, + ], + output: ` + declare const varBoolean: boolean; + if (varBoolean) { + } + `, + }, + { + code: ` + declare const varBoolean: boolean; + if (true !== varBoolean) { + } + `, + errors: [ + { + messageId: 'negated', + }, + ], + output: ` + declare const varBoolean: boolean; + if (!varBoolean) { + } + `, + }, ], }); From a6c5604b65b6330d047aa016fc46b8a597a6ae58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 1 Aug 2021 01:28:50 +0200 Subject: [PATCH 17/27] feat(ast-spec): make `BaseNode` & `BaseToken` more type-safe (#3560) --- packages/ast-spec/src/base/BaseNode.ts | 21 +++++++------------ packages/ast-spec/src/base/BaseToken.ts | 6 ++++-- packages/ast-spec/src/base/NodeOrTokenData.ts | 17 +++++++++++++++ packages/ast-spec/src/index.ts | 2 +- .../experimental-utils/src/ts-eslint/Rule.ts | 4 ++-- packages/typescript-estree/src/convert.ts | 2 +- 6 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 packages/ast-spec/src/base/NodeOrTokenData.ts diff --git a/packages/ast-spec/src/base/BaseNode.ts b/packages/ast-spec/src/base/BaseNode.ts index 362f156832b..797b3d35132 100644 --- a/packages/ast-spec/src/base/BaseNode.ts +++ b/packages/ast-spec/src/base/BaseNode.ts @@ -1,22 +1,15 @@ // import type { Node } from '../unions/Node'; -import type { Range } from './Range'; -import type { SourceLocation } from './SourceLocation'; +import type { AST_NODE_TYPES } from '../ast-node-types'; +import type { NodeOrTokenData } from './NodeOrTokenData'; -export interface BaseNode { - /** - * The source location information of the node. - * @see {SourceLocation} - */ - loc: SourceLocation; - /** - * @see {Range} - */ - range: Range; +export interface BaseNode extends NodeOrTokenData { /** * The parent node of the current node + * + * This is added in the @typescript-eslint/types package as ESLint adds it + * while traversing. */ // parent?: Node; - // every node *will* have a type, but let the nodes define their own exact string - // type: string; + type: AST_NODE_TYPES; } diff --git a/packages/ast-spec/src/base/BaseToken.ts b/packages/ast-spec/src/base/BaseToken.ts index cdf0d128643..8780cfcb969 100644 --- a/packages/ast-spec/src/base/BaseToken.ts +++ b/packages/ast-spec/src/base/BaseToken.ts @@ -1,8 +1,10 @@ -import type { BaseNode } from './BaseNode'; +import type { AST_TOKEN_TYPES } from '../ast-token-types'; +import type { NodeOrTokenData } from './NodeOrTokenData'; /* * Token and Comment are pseudo-nodes to represent pieces of source code */ -export interface BaseToken extends BaseNode { +export interface BaseToken extends NodeOrTokenData { + type: AST_TOKEN_TYPES; value: string; } diff --git a/packages/ast-spec/src/base/NodeOrTokenData.ts b/packages/ast-spec/src/base/NodeOrTokenData.ts new file mode 100644 index 00000000000..8052278bbf0 --- /dev/null +++ b/packages/ast-spec/src/base/NodeOrTokenData.ts @@ -0,0 +1,17 @@ +import type { Range } from './Range'; +import type { SourceLocation } from './SourceLocation'; + +export interface NodeOrTokenData { + /** + * The source location information of the node. + * @see {SourceLocation} + */ + loc: SourceLocation; + + /** + * @see {Range} + */ + range: Range; + + type: string; +} diff --git a/packages/ast-spec/src/index.ts b/packages/ast-spec/src/index.ts index bd4b6584482..c0dc09b70b0 100644 --- a/packages/ast-spec/src/index.ts +++ b/packages/ast-spec/src/index.ts @@ -1,7 +1,7 @@ export * from './base/Accessibility'; export * from './base/BaseNode'; // this is exported so that the `types` package can merge the decl and add the `parent` property -export * from './base/OptionalRangeAndLoc'; export * from './base/LineAndColumnData'; +export * from './base/OptionalRangeAndLoc'; export * from './base/Range'; export * from './base/SourceLocation'; diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts index 20a7735f08b..13902737223 100644 --- a/packages/experimental-utils/src/ts-eslint/Rule.ts +++ b/packages/experimental-utils/src/ts-eslint/Rule.ts @@ -277,7 +277,7 @@ interface RuleListener { ClassDeclaration?: RuleFunction; ClassExpression?: RuleFunction; ClassProperty?: RuleFunction; - Comment?: RuleFunction; + // Comment?: RuleFunction; ConditionalExpression?: RuleFunction; ContinueStatement?: RuleFunction; DebuggerStatement?: RuleFunction; @@ -338,7 +338,7 @@ interface RuleListener { TemplateLiteral?: RuleFunction; ThisExpression?: RuleFunction; ThrowStatement?: RuleFunction; - Token?: RuleFunction; + // Token?: RuleFunction; TryStatement?: RuleFunction; TSAbstractClassProperty?: RuleFunction; TSAbstractKeyword?: RuleFunction; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 567da9d88ca..a49b15a5e53 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -199,7 +199,7 @@ export class Converter { */ private registerTSNodeInNodeMap( node: ts.Node, - result: TSESTree.BaseNode | null, + result: TSESTree.Node | null, ): void { if (result && this.options.shouldPreserveNodeMaps) { if (!this.tsNodeToESTreeNodeMap.has(node)) { From 6e9796fecbb85b9dc278e2c13c42009dde77b81c Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sat, 31 Jul 2021 16:30:03 -0700 Subject: [PATCH 18/27] docs(eslint-plugin): [no-use-before-define] fix typo and outdated issue (#3592) --- packages/eslint-plugin/docs/rules/no-use-before-define.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-use-before-define.md b/packages/eslint-plugin/docs/rules/no-use-before-define.md index dfdab4d60f7..d7ec0aadd73 100644 --- a/packages/eslint-plugin/docs/rules/no-use-before-define.md +++ b/packages/eslint-plugin/docs/rules/no-use-before-define.md @@ -1,7 +1,5 @@ # Disallow the use of variables before they are defined (`no-use-before-define`) -## PLEASE READ THIS ISSUE BEFORE USING THIS RULE [#1856](https://github.com/typescript-eslint/typescript-eslint/issues/1856) - ## Rule Details This rule extends the base [`eslint/no-use-before-define`](https://eslint.org/docs/rules/no-use-before-define) rule. @@ -42,10 +40,10 @@ const defaultOptions: Options = { If this is `true`, this rule warns every reference to a enum before the enum declaration. If this is `false`, this rule will ignore references to enums, when the reference is in a child scope. -Examples of **incorrect** code for the `{ "enums": false }` option: +Examples of **incorrect** code for the `{ "enums": true }` option: ```ts -/*eslint no-use-before-define: ["error", { "enums": false }]*/ +/*eslint no-use-before-define: ["error", { "enums": true }]*/ const x = Foo.FOO; From f5a6806ae4291f540eef73cd5c182c985c5059e7 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 1 Aug 2021 02:31:18 +0300 Subject: [PATCH 19/27] fix(eslint-plugin): [no-implied-eval] handle bind on nested member expressions (#3598) --- .../src/rules/no-implied-eval.ts | 12 ++++++----- .../tests/rules/no-implied-eval.test.ts | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-implied-eval.ts b/packages/eslint-plugin/src/rules/no-implied-eval.ts index c7caf2d4bef..4d3d645cb9e 100644 --- a/packages/eslint-plugin/src/rules/no-implied-eval.ts +++ b/packages/eslint-plugin/src/rules/no-implied-eval.ts @@ -99,6 +99,12 @@ export default util.createRule({ return signatures.length > 0; } + function isBind(node: TSESTree.Node): boolean { + return node.type === AST_NODE_TYPES.MemberExpression + ? isBind(node.property) + : node.type === AST_NODE_TYPES.Identifier && node.name === 'bind'; + } + function isFunction(node: TSESTree.Node): boolean { switch (node.type) { case AST_NODE_TYPES.ArrowFunctionExpression: @@ -112,11 +118,7 @@ export default util.createRule({ return isFunctionType(node); case AST_NODE_TYPES.CallExpression: - return ( - (node.callee.type === AST_NODE_TYPES.Identifier && - node.callee.name === 'bind') || - isFunctionType(node) - ); + return isBind(node.callee) || isFunctionType(node); default: return false; diff --git a/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts b/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts index de619abbc8b..5abb7406f57 100644 --- a/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts +++ b/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts @@ -257,6 +257,26 @@ const bar = () => {}; setTimeout(Math.radom() > 0.5 ? foo : bar, 0); `, + ` +class Foo { + func1() {} + func2(): void { + setTimeout(this.func1.bind(this), 1); + } +} + `, + ` +class Foo { + private a = { + b: { + c: function () {}, + }, + }; + funcw(): void { + setTimeout(this.a.b.c.bind(this), 1); + } +} + `, ], invalid: [ From 4a196b5818bb8557a7d3c5abae81fbd8021d9cb9 Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Sat, 31 Jul 2021 19:34:01 -0400 Subject: [PATCH 20/27] fix(eslint-plugin): [return-await] handle nested functions correctly (#3601) --- .../eslint-plugin/src/rules/return-await.ts | 26 ++++++--- .../tests/rules/return-await.test.ts | 53 +++++++++++++++++++ 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index 85a2eebe1f5..c7dc42888b6 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -7,15 +7,16 @@ import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; -interface ScopeInfo { - hasAsync: boolean; -} - type FunctionNode = | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression; +interface ScopeInfo { + hasAsync: boolean; + owningFunc: FunctionNode; +} + export default util.createRule({ name: 'return-await', meta: { @@ -49,12 +50,17 @@ export default util.createRule({ const checker = parserServices.program.getTypeChecker(); const sourceCode = context.getSourceCode(); - let scopeInfo: ScopeInfo | null = null; + const scopeInfoStack: ScopeInfo[] = []; function enterFunction(node: FunctionNode): void { - scopeInfo = { + scopeInfoStack.push({ hasAsync: node.async, - }; + owningFunc: node, + }); + } + + function exitFunction(): void { + scopeInfoStack.pop(); } function inTry(node: ts.Node): boolean { @@ -263,6 +269,11 @@ export default util.createRule({ FunctionExpression: enterFunction, ArrowFunctionExpression: enterFunction, + 'FunctionDeclaration:exit': exitFunction, + 'FunctionExpression:exit': exitFunction, + 'ArrowFunctionExpression:exit': exitFunction, + + // executes after less specific handler, so exitFunction is called 'ArrowFunctionExpression[async = true]:exit'( node: TSESTree.ArrowFunctionExpression, ): void { @@ -274,6 +285,7 @@ export default util.createRule({ } }, ReturnStatement(node): void { + const scopeInfo = scopeInfoStack[scopeInfoStack.length - 1]; if (!scopeInfo || !scopeInfo.hasAsync || !node.argument) { return; } diff --git a/packages/eslint-plugin/tests/rules/return-await.test.ts b/packages/eslint-plugin/tests/rules/return-await.test.ts index 73056f6091c..91f3a71157b 100644 --- a/packages/eslint-plugin/tests/rules/return-await.test.ts +++ b/packages/eslint-plugin/tests/rules/return-await.test.ts @@ -232,6 +232,21 @@ ruleTester.run('return-await', rule, { } `, }, + { + code: ` + async function test() { + const res = await Promise.resolve('{}'); + try { + async function nested() { + return Promise.resolve('ok'); + } + return await nested(); + } catch (error) { + return await Promise.resolve('error'); + } + } + `, + }, ], invalid: [ { @@ -827,5 +842,43 @@ const buzz = async () => ((await foo()) ? 1 : await bar()); }, ], }, + { + code: ` + async function test() { + try { + const callback1 = function () {}; + const callback2 = async function () {}; + function callback3() {} + async function callback4() {} + const callback5 = () => {}; + const callback6 = async () => {}; + return Promise.resolve('try'); + } finally { + return Promise.resolve('finally'); + } + } + `, + output: ` + async function test() { + try { + const callback1 = function () {}; + const callback2 = async function () {}; + function callback3() {} + async function callback4() {} + const callback5 = () => {}; + const callback6 = async () => {}; + return await Promise.resolve('try'); + } finally { + return Promise.resolve('finally'); + } + } + `, + errors: [ + { + line: 10, + messageId: 'requiredPromiseAwait', + }, + ], + }, ], }); From 216cf829c632510a51e266a854404e8aaf07f30c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 31 Jul 2021 16:39:37 -0700 Subject: [PATCH 21/27] chore: bump marked from 2.1.1 to 2.1.3 (#3589) Bumps [marked](https://github.com/markedjs/marked) from 2.1.1 to 2.1.3. - [Release notes](https://github.com/markedjs/marked/releases) - [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js) - [Commits](https://github.com/markedjs/marked/compare/v2.1.1...v2.1.3) --- updated-dependencies: - dependency-name: marked dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2133d098ab8..80dc6704dc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3936,10 +3936,10 @@ didyoumean@^1.2.1: resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.1.tgz#e92edfdada6537d484d73c0172fd1eba0c4976ff" integrity sha1-6S7f2tplN9SE1zwBcv0eugxJdv8= -diff-sequences@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.1.tgz#9c9801d52ed5f576ff0a20e3022a13ee6e297e7c" - integrity sha512-XPLijkfJUh/PIBnfkcSHgvD6tlYixmcMAn3osTk6jt+H0v/mgURto1XUiD9DKuGX5NDoVS6dSlA23gd9FUaCFg== +diff-sequences@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" + integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== diff@^4.0.1: version "4.0.2" @@ -6023,14 +6023,14 @@ jest-config@^27.0.4: pretty-format "^27.0.2" jest-diff@^26.0.0, jest-diff@^27.0.0, jest-diff@^27.0.2, jest-diff@^27.0.6: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.2.tgz#f315b87cee5dc134cf42c2708ab27375cc3f5a7e" - integrity sha512-BFIdRb0LqfV1hBt8crQmw6gGQHVDhM87SpMIZ45FPYKReZYG5er1+5pIn2zKqvrJp6WNox0ylR8571Iwk2Dmgw== + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.6.tgz#4a7a19ee6f04ad70e0e3388f35829394a44c7b5e" + integrity sha512-Z1mqgkTCSYaFgwTlP/NUiRzdqgxmmhzHY1Tq17zL94morOHfHu3K4bgSgl+CR4GLhpV8VxkuOYuIWnQ9LnFqmg== dependencies: chalk "^4.0.0" - diff-sequences "^27.0.1" - jest-get-type "^27.0.1" - pretty-format "^27.0.2" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.0.6" jest-docblock@^27.0.1: version "27.0.1" @@ -7291,9 +7291,9 @@ markdownlint@~0.23.1: markdown-it "12.0.4" marked@^2.0.6: - version "2.1.1" - resolved "https://registry.yarnpkg.com/marked/-/marked-2.1.1.tgz#b7c27f520fc4de0ddd049d9b4be3b04e06314923" - integrity sha512-5XFS69o9CzDpQDSpUYC+AN2xvq8yl1EGa5SG/GI1hP78/uTeo3PDfiDNmsUyiahpyhToDDJhQk7fNtJsga+KVw== + version "2.1.3" + resolved "https://registry.yarnpkg.com/marked/-/marked-2.1.3.tgz#bd017cef6431724fd4b27e0657f5ceb14bff3753" + integrity sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA== mdurl@^1.0.1: version "1.0.1" @@ -8329,11 +8329,11 @@ prettier@2.3.2: integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== pretty-format@*, pretty-format@^26.0.0, pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.0.6: - version "27.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.2.tgz#9283ff8c4f581b186b2d4da461617143dca478a4" - integrity sha512-mXKbbBPnYTG7Yra9qFBtqj+IXcsvxsvOBco3QHxtxTl+hHKq6QdzMZ+q0CtL4ORHZgwGImRr2XZUX2EWzORxig== + version "27.0.6" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.6.tgz#ab770c47b2c6f893a21aefc57b75da63ef49a11f" + integrity sha512-8tGD7gBIENgzqA+UBzObyWqQ5B778VIFZA/S66cclyd5YkFLYs2Js7gxDKf0MXtTc9zcS7t1xhdfcElJ3YIvkQ== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1" From 9750c6f7d0059e2e8f79cd4d7ced5d6d24c90f4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 31 Jul 2021 16:44:19 -0700 Subject: [PATCH 22/27] chore: bump @nrwl/tao from 12.6.0 to 12.6.3 (#3662) Bumps [@nrwl/tao](https://github.com/nrwl/nx) from 12.6.0 to 12.6.3. - [Release notes](https://github.com/nrwl/nx/releases) - [Commits](https://github.com/nrwl/nx/compare/12.6.0...12.6.3) --- updated-dependencies: - dependency-name: "@nrwl/tao" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a04cb34c321..b1ca5dd3813 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@commitlint/config-lerna-scopes": "^12.1.4", "@nrwl/cli": "12.6.0", "@nrwl/nx-cloud": "12.3.0", - "@nrwl/tao": "12.6.0", + "@nrwl/tao": "12.6.3", "@nrwl/workspace": "12.6.0", "@types/babel__code-frame": "^7.0.2", "@types/debug": "^4.1.5", diff --git a/yarn.lock b/yarn.lock index 80dc6704dc2..b08b6f95733 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1922,6 +1922,22 @@ tslib "^2.0.0" yargs-parser "20.0.0" +"@nrwl/tao@12.6.3": + version "12.6.3" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-12.6.3.tgz#3eee7eee4d18a0580eee30fe3e3df0193195bc07" + integrity sha512-KlVdQEyxi/mk0X9FBY6w72XouiMesD3FCCrqgKx5oShOx2GehuP+LhOOrfnuMOT7WgKBCoHnqhnK1x6X1F5/XQ== + dependencies: + chalk "4.1.0" + enquirer "~2.3.6" + fs-extra "^9.1.0" + jsonc-parser "3.0.0" + rxjs "^6.5.4" + rxjs-for-await "0.0.2" + semver "7.3.4" + tmp "~0.2.1" + tslib "^2.0.0" + yargs-parser "20.0.0" + "@nrwl/workspace@12.6.0": version "12.6.0" resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-12.6.0.tgz#101fda472268008ca64ac5478b95ae17735f93b4" From 93b8860eeb0059451b3eb5ee2f0b57dba6d9c290 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 31 Jul 2021 17:18:50 -0700 Subject: [PATCH 23/27] chore: bump @microsoft/api-extractor from 7.16.1 to 7.18.4 (#3663) Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack) from 7.16.1 to 7.18.4. - [Release notes](https://github.com/microsoft/rushstack/releases) - [Commits](https://github.com/microsoft/rushstack/compare/@microsoft/api-extractor_v7.16.1...@microsoft/api-extractor_v7.18.4) --- updated-dependencies: - dependency-name: "@microsoft/api-extractor" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/yarn.lock b/yarn.lock index b08b6f95733..c9c527d7875 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1768,32 +1768,32 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" -"@microsoft/api-extractor-model@7.13.3": - version "7.13.3" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.13.3.tgz#ac01c064c5af520d3661c85d7e5ef95e1ca8ab92" - integrity sha512-uXilAhu2GcvyY/0NwVRk3AN7TFYjkPnjHLV2UywTTz9uglS+Af0YjNrCy+aaK8qXtfbFWdBzkH9N2XU8/YBeRQ== +"@microsoft/api-extractor-model@7.13.4": + version "7.13.4" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.13.4.tgz#bff4a52a35da5d9896650041d4f7a769c970da60" + integrity sha512-NYaR3hJinh089/Gkee8fvmEFf9zKkoUvNxgkqUlKBCDXH2+Ou4tNDuL8G6zjhKBPicHkp2VcL8l7q9H6txUkjQ== dependencies: "@microsoft/tsdoc" "0.13.2" "@microsoft/tsdoc-config" "~0.15.2" - "@rushstack/node-core-library" "3.39.0" + "@rushstack/node-core-library" "3.39.1" "@microsoft/api-extractor@^7.15.2": - version "7.16.1" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.16.1.tgz#7d5490a2ce1441ab8bc7bd6866a350cf580de0d0" - integrity sha512-hKFoLdmEUbHMIH48MXzSg8rndiugrXHruMVk+BQvhu14yX3LxH9re1CKwj4vLZb7bVBn+FfaWSZ5d3ltiXvX3w== + version "7.18.4" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.18.4.tgz#2d7641b36d323b4ac710d838a972be7e4f14d32b" + integrity sha512-Wx45VuIAu09Pk9Qwzt0I57OX31BaWO2r6+mfSXqYFsJjYTqwUkdFh92G1GKYgvuR9oF/ai7w10wrFpx5WZYbGg== dependencies: - "@microsoft/api-extractor-model" "7.13.3" + "@microsoft/api-extractor-model" "7.13.4" "@microsoft/tsdoc" "0.13.2" "@microsoft/tsdoc-config" "~0.15.2" - "@rushstack/node-core-library" "3.39.0" - "@rushstack/rig-package" "0.2.12" - "@rushstack/ts-command-line" "4.7.10" + "@rushstack/node-core-library" "3.39.1" + "@rushstack/rig-package" "0.2.13" + "@rushstack/ts-command-line" "4.8.1" colors "~1.2.1" lodash "~4.17.15" resolve "~1.17.0" semver "~7.3.0" source-map "~0.6.1" - typescript "~4.3.2" + typescript "~4.3.5" "@microsoft/tsdoc-config@~0.15.2": version "0.15.2" @@ -2075,10 +2075,10 @@ dependencies: "@types/node" ">= 8" -"@rushstack/node-core-library@3.39.0": - version "3.39.0" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.39.0.tgz#38928946d15ae89b773386cf97433d0d1ec83b93" - integrity sha512-kgu3+7/zOBkZU0+NdJb1rcHcpk3/oTjn5c8cg5nUTn+JDjEw58yG83SoeJEcRNNdl11dGX0lKG2PxPsjCokZOQ== +"@rushstack/node-core-library@3.39.1": + version "3.39.1" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.39.1.tgz#dd1dc270e3035ac4de270f0ca80c25724ce19cc7" + integrity sha512-HHgMEHZTXQ3NjpQzWd5+fSt2Eod9yFwj6qBPbaeaNtDNkOL8wbLoxVimQNtcH0Qhn4wxF5u2NTDNFsxf2yd1jw== dependencies: "@types/node" "10.17.13" colors "~1.2.1" @@ -2090,18 +2090,18 @@ timsort "~0.3.0" z-schema "~3.18.3" -"@rushstack/rig-package@0.2.12": - version "0.2.12" - resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.2.12.tgz#c434d62b28e0418a040938226f8913971d0424c7" - integrity sha512-nbePcvF8hQwv0ql9aeQxcaMPK/h1OLAC00W7fWCRWIvD2MchZOE8jumIIr66HGrfG2X1sw++m/ZYI4D+BM5ovQ== +"@rushstack/rig-package@0.2.13": + version "0.2.13" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.2.13.tgz#418f0aeb4c9b33bd8bd2547759fc0ae91fd970c7" + integrity sha512-qQMAFKvfb2ooaWU9DrGIK9d8QfyHy/HiuITJbWenlKgzcDXQvQgEduk57YF4Y7LLasDJ5ZzLaaXwlfX8qCRe5Q== dependencies: resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/ts-command-line@4.7.10": - version "4.7.10" - resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.7.10.tgz#a2ec6efb1945b79b496671ce90eb1be4f1397d31" - integrity sha512-8t042g8eerypNOEcdpxwRA3uCmz0duMo21rG4Z2mdz7JxJeylDmzjlU3wDdef2t3P1Z61JCdZB6fbm1Mh0zi7w== +"@rushstack/ts-command-line@4.8.1": + version "4.8.1" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.8.1.tgz#c233a0226112338e58e7e4fd219247b4e7cec883" + integrity sha512-rmxvYdCNRbyRs+DYAPye3g6lkCkWHleqO40K8UPvUAzFqEuj6+YCVssBiOmrUDCoM5gaegSNT0wFDYhz24DWtw== dependencies: "@types/argparse" "1.0.38" argparse "~1.0.9" @@ -9850,7 +9850,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@4.3.5, "typescript@>=3.3.1 <4.4.0", typescript@^4.1.0-dev.20201026, typescript@~4.3.2: +typescript@*, typescript@4.3.5, "typescript@>=3.3.1 <4.4.0", typescript@^4.1.0-dev.20201026, typescript@~4.3.5: version "4.3.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== From ddb11ac60c6590fef9be8c598128df861e300075 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 31 Jul 2021 17:19:07 -0700 Subject: [PATCH 24/27] chore: bump @types/marked from 2.0.3 to 2.0.4 (#3654) Bumps [@types/marked](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/marked) from 2.0.3 to 2.0.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/marked) --- updated-dependencies: - dependency-name: "@types/marked" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c9c527d7875..e599133f7b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2275,9 +2275,9 @@ integrity sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q== "@types/marked@*", "@types/marked@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-2.0.3.tgz#c8ea93684e530cc3b667d3e7226556dd0844ad1f" - integrity sha512-lbhSN1rht/tQ+dSWxawCzGgTfxe9DB31iLgiT1ZVT5lshpam/nyOA1m3tKHRoNPctB2ukSL22JZI5Fr+WI/zYg== + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-2.0.4.tgz#34a0ea548afe6e0c01095229d47b48b2af650613" + integrity sha512-L9VRSe0Id8xbPL99mUo/4aKgD7ZoRwFZqUQScNKHi2pFjF9ZYSMNShUHD6VlMT6J/prQq0T1mxuU25m3R7dFzg== "@types/minimatch@*": version "3.0.4" From 3db653276b97d79f9b0c93b48f4fd0b62d58f694 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 31 Jul 2021 20:20:11 -0400 Subject: [PATCH 25/27] chore: enabled no-unsafe-member-access internally (#3483) * chore: enabled no-unsafe-member-access internally * Update packages/scope-manager/tests/util/serializers/TSESTreeNode.ts Co-authored-by: Brad Zacher * fix: missing import * fix: one last lint disable * Update convert.ts * Update .eslintrc.js * Update .eslintrc.js Co-authored-by: Brad Zacher --- .eslintrc.js | 7 +++++-- packages/eslint-plugin/src/util/createRule.ts | 2 +- packages/experimental-utils/src/eslint-utils/RuleTester.ts | 2 +- packages/parser/src/index.ts | 2 +- .../scope-manager/tests/util/serializers/TSESTreeNode.ts | 4 ++-- packages/typescript-estree/src/convert.ts | 2 +- packages/typescript-estree/src/index.ts | 2 +- packages/typescript-estree/src/node-utils.ts | 3 +-- .../typescript-estree/src/semantic-or-syntactic-errors.ts | 2 +- packages/typescript-estree/src/simple-traverse.ts | 1 + packages/typescript-estree/tests/ast-alignment/parse.ts | 2 +- packages/typescript-estree/tests/ast-alignment/utils.ts | 2 +- packages/typescript-estree/typings/typescript.d.ts | 6 +++++- 13 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e03f3106c93..df695f85e94 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -65,7 +65,6 @@ module.exports = { ], // TODO - enable these new recommended rules - '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/restrict-template-expressions': 'off', // TODO - enable this '@typescript-eslint/naming-convention': 'off', @@ -163,8 +162,10 @@ module.exports = { // all test files { files: [ - 'packages/*/tests/**/*.test.ts', 'packages/*/tests/**/*.spec.ts', + 'packages/*/tests/**/*.test.ts', + 'packages/*/tests/**/spec.ts', + 'packages/*/tests/**/test.ts', 'packages/parser/tests/**/*.ts', ], env: { @@ -172,6 +173,7 @@ module.exports = { }, rules: { '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', 'eslint-plugin/no-identical-tests': 'error', 'jest/no-disabled-tests': 'warn', @@ -198,6 +200,7 @@ module.exports = { rules: { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/restrict-plus-operands': 'off', }, diff --git a/packages/eslint-plugin/src/util/createRule.ts b/packages/eslint-plugin/src/util/createRule.ts index d56fe6d2a7d..8e69adb9565 100644 --- a/packages/eslint-plugin/src/util/createRule.ts +++ b/packages/eslint-plugin/src/util/createRule.ts @@ -1,7 +1,7 @@ import { ESLintUtils } from '@typescript-eslint/experimental-utils'; // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const version: string = require('../../package.json').version; export const createRule = ESLintUtils.RuleCreator( diff --git a/packages/experimental-utils/src/eslint-utils/RuleTester.ts b/packages/experimental-utils/src/eslint-utils/RuleTester.ts index a3210162e98..f2af7a290fd 100644 --- a/packages/experimental-utils/src/eslint-utils/RuleTester.ts +++ b/packages/experimental-utils/src/eslint-utils/RuleTester.ts @@ -32,7 +32,7 @@ class RuleTester extends TSESLint.RuleTester { try { // instead of creating a hard dependency, just use a soft require // a bit weird, but if they're using this tooling, it'll be installed - // eslint-disable-next-line @typescript-eslint/no-unsafe-call + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access require(parser).clearCaches(); } catch { // ignored diff --git a/packages/parser/src/index.ts b/packages/parser/src/index.ts index c1bb82bf593..928671a3c5c 100644 --- a/packages/parser/src/index.ts +++ b/packages/parser/src/index.ts @@ -6,5 +6,5 @@ export { } from '@typescript-eslint/typescript-estree'; // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access export const version: string = require('../package.json').version; diff --git a/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts b/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts index 3d57ab11d73..8a75e729fd8 100644 --- a/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts +++ b/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/types'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; import { NewPlugin } from 'pretty-format'; import { createIdGenerator } from '../../../src/ID'; @@ -24,7 +24,7 @@ const serializer: NewPlugin = { // make sure it's not one of the classes from the package Object.getPrototypeOf(val) === Object.prototype && 'type' in val && - val.type in AST_NODE_TYPES + (val as TSESTree.Node).type in AST_NODE_TYPES ); }, serialize(node: Node): string { diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index a49b15a5e53..7f8514d8bc0 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,5 +1,5 @@ // There's lots of funny stuff due to the typing of ts.Node -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */ import * as ts from 'typescript'; import { canContainDirective, diff --git a/packages/typescript-estree/src/index.ts b/packages/typescript-estree/src/index.ts index b2a0581dc92..5ed06629f17 100644 --- a/packages/typescript-estree/src/index.ts +++ b/packages/typescript-estree/src/index.ts @@ -9,5 +9,5 @@ export { createProgramFromConfigFile as createProgram } from './create-program/u export { visitorKeys } from '@typescript-eslint/visitor-keys'; // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access export const version: string = require('../package.json').version; diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 1969b6b2fb3..8c223ed650a 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -632,8 +632,7 @@ export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean { // If we have a token or node that has a non-zero width, it must have tokens. // Note: getWidth() does not take trivia into account. return n.kind === SyntaxKind.EndOfFileToken - ? // eslint-disable-next-line @typescript-eslint/no-explicit-any - !!(n as any).jsDoc + ? !!(n as ts.JSDocContainer).jsDoc : n.getWidth(ast) !== 0; } diff --git a/packages/typescript-estree/src/semantic-or-syntactic-errors.ts b/packages/typescript-estree/src/semantic-or-syntactic-errors.ts index 023d7e3faf8..fab5cd642e0 100644 --- a/packages/typescript-estree/src/semantic-or-syntactic-errors.ts +++ b/packages/typescript-estree/src/semantic-or-syntactic-errors.ts @@ -45,7 +45,7 @@ export function getFirstSemanticOrSyntacticError( * and log a a warning. */ /* istanbul ignore next */ - console.warn(`Warning From TSC: "${e.message}`); // eslint-disable-line no-console + console.warn(`Warning From TSC: "${(e as Error).message}`); // eslint-disable-line no-console /* istanbul ignore next */ return undefined; } diff --git a/packages/typescript-estree/src/simple-traverse.ts b/packages/typescript-estree/src/simple-traverse.ts index 4d4ddaa5f18..f513e54b14f 100644 --- a/packages/typescript-estree/src/simple-traverse.ts +++ b/packages/typescript-estree/src/simple-traverse.ts @@ -3,6 +3,7 @@ import { TSESTree } from './ts-estree'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function isValidNode(x: any): x is TSESTree.Node { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return x !== null && typeof x === 'object' && typeof x.type === 'string'; } diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 0a643827f3e..7a463d97256 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ import type babelParser from '@babel/parser'; import { ParserPlugin } from '@babel/parser'; diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 34b318898c1..3cecac3f09f 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,5 +1,5 @@ // babel types are something we don't really care about -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/restrict-plus-operands */ +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-plus-operands */ import { AST_NODE_TYPES, TSESTree } from '../../src/ts-estree'; import { deeplyCopy, omitDeep } from '../../tools/test-utils'; import * as BabelTypes from '@babel/types'; diff --git a/packages/typescript-estree/typings/typescript.d.ts b/packages/typescript-estree/typings/typescript.d.ts index 73268ec9052..a247b280884 100644 --- a/packages/typescript-estree/typings/typescript.d.ts +++ b/packages/typescript-estree/typings/typescript.d.ts @@ -1,9 +1,13 @@ import 'typescript'; +// these additions are marked as internal to typescript declare module 'typescript' { interface SourceFile { - // this is marked as internal to typescript externalModuleIndicator?: Node; parseDiagnostics: DiagnosticWithLocation[]; } + + interface JSDocContainer { + jsDoc?: JSDoc[]; + } } From 02998eac510665758b9a093d43afc310f3ac980d Mon Sep 17 00:00:00 2001 From: Alex Anthony Date: Sun, 1 Aug 2021 01:20:23 +0100 Subject: [PATCH 26/27] feat(eslint-plugin): Catch unused React import with new JSX transform (#3577) --- .../no-unused-vars/no-unused-vars.test.ts | 27 +++++++++++++++++++ packages/parser/README.md | 4 +-- packages/scope-manager/src/analyze.ts | 7 +++-- .../src/referencer/Referencer.ts | 6 ++--- packages/types/src/parser-options.ts | 2 +- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts index e13dfc6f849..fb7eadb47b7 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts @@ -1576,6 +1576,33 @@ export const ComponentFoo = () => { }, ], }, + // https://github.com/typescript-eslint/typescript-eslint/issues/3303 + { + code: ` +import React from 'react'; + +export const ComponentFoo = () => { + return
Foo Foo
; +}; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxPragma: null, + }, + errors: [ + { + messageId: 'unusedVar', + line: 2, + data: { + varName: 'React', + action: 'defined', + additional: '', + }, + }, + ], + }, { code: ` declare module 'foo' { diff --git a/packages/parser/README.md b/packages/parser/README.md index 70ca5bf63d6..d76219e1ae9 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -55,7 +55,7 @@ interface ParserOptions { }; ecmaVersion?: number; - jsxPragma?: string; + jsxPragma?: string | null; jsxFragmentName?: string | null; lib?: string[]; @@ -111,7 +111,7 @@ Specifies the version of ECMAScript syntax you want to use. This is used by the Default `'React'` The identifier that's used for JSX Elements creation (after transpilation). -If you're using a library other than React (like `preact`), then you should change this value. +If you're using a library other than React (like `preact`), then you should change this value. If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`. This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`). diff --git a/packages/scope-manager/src/analyze.ts b/packages/scope-manager/src/analyze.ts index 1aaf874049f..9845a3c1750 100644 --- a/packages/scope-manager/src/analyze.ts +++ b/packages/scope-manager/src/analyze.ts @@ -38,7 +38,7 @@ interface AnalyzeOptions { * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). * Defaults to `"React"`. */ - jsxPragma?: string; + jsxPragma?: string | null; /** * The identifier that's used for JSX fragment elements (after transpilation). @@ -108,7 +108,10 @@ function analyze( globalReturn: providedOptions?.globalReturn ?? DEFAULT_OPTIONS.globalReturn, impliedStrict: providedOptions?.impliedStrict ?? DEFAULT_OPTIONS.impliedStrict, - jsxPragma: providedOptions?.jsxPragma ?? DEFAULT_OPTIONS.jsxPragma, + jsxPragma: + providedOptions?.jsxPragma === undefined + ? DEFAULT_OPTIONS.jsxPragma + : providedOptions.jsxPragma, jsxFragmentName: providedOptions?.jsxFragmentName ?? DEFAULT_OPTIONS.jsxFragmentName, sourceType: providedOptions?.sourceType ?? DEFAULT_OPTIONS.sourceType, diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index f35830e6acd..df4c318dadd 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -22,7 +22,7 @@ import { lib as TSLibraries } from '../lib'; import { Scope, GlobalScope } from '../scope'; interface ReferencerOptions extends VisitorOptions { - jsxPragma: string; + jsxPragma: string | null; jsxFragmentName: string | null; lib: Lib[]; emitDecoratorMetadata: boolean; @@ -30,7 +30,7 @@ interface ReferencerOptions extends VisitorOptions { // Referencing variables and creating bindings. class Referencer extends Visitor { - #jsxPragma: string; + #jsxPragma: string | null; #jsxFragmentName: string | null; #hasReferencedJsxFactory = false; #hasReferencedJsxFragmentFactory = false; @@ -120,7 +120,7 @@ class Referencer extends Visitor { } private referenceJsxPragma(): void { - if (this.#hasReferencedJsxFactory) { + if (this.#jsxPragma === null || this.#hasReferencedJsxFactory) { return; } this.#hasReferencedJsxFactory = this.referenceInSomeUpperScope( diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index 850086e1c5b..9a761a37b97 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -29,7 +29,7 @@ interface ParserOptions { ecmaVersion?: EcmaVersion; // scope-manager specific - jsxPragma?: string; + jsxPragma?: string | null; jsxFragmentName?: string | null; lib?: Lib[]; From 62bcc937f08cd18296ffbe96a3551ec1fb87aecd Mon Sep 17 00:00:00 2001 From: JounQin Date: Sun, 1 Aug 2021 08:20:40 +0800 Subject: [PATCH 27/27] fix(typescript-estree): correct tty check (#3635) --- packages/typescript-estree/src/parser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 3701a8862b3..69132424ba2 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -351,7 +351,8 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { function warnAboutTSVersion(): void { if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { - const isTTY = typeof process === undefined ? false : process.stdout?.isTTY; + const isTTY = + typeof process === 'undefined' ? false : process.stdout?.isTTY; if (isTTY) { const border = '============='; const versionWarning = [