diff --git a/.eslintrc.js b/.eslintrc.js index f3f97eebf54e..3c25f781dfc0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,12 +1,13 @@ module.exports = { root: true, plugins: [ - 'eslint-plugin', '@typescript-eslint', - 'jest', - 'import', - 'eslint-comments', '@typescript-eslint/internal', + 'deprecation', + 'eslint-comments', + 'eslint-plugin', + 'import', + 'jest', 'simple-import-sort', ], env: { @@ -41,6 +42,9 @@ module.exports = { EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, }, rules: { + // make sure we're not leveraging any deprecated APIs + 'deprecation/deprecation': 'error', + // // our plugin :D // diff --git a/.github/actions/prepare-install/action.yml b/.github/actions/prepare-install/action.yml index bcb843c9a61c..85051b4885d9 100644 --- a/.github/actions/prepare-install/action.yml +++ b/.github/actions/prepare-install/action.yml @@ -44,3 +44,4 @@ runs: run: | yarn --ignore-engines --frozen-lockfile --ignore-scripts yarn check-clean-workspace-after-install + yarn patch-package diff --git a/CHANGELOG.md b/CHANGELOG.md index f6816d2a5715..1d0ad2f52eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Bug Fixes + +* **eslint-plugin:** revert [#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266) ([#5564](https://github.com/typescript-eslint/typescript-eslint/issues/5564)) ([7a8afe2](https://github.com/typescript-eslint/typescript-eslint/commit/7a8afe29039c6c80fe584acaf5d933424a4452a9)) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) diff --git a/README.md b/README.md index 10c836bcfdfe..bddf59d198b7 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The latest version under the `canary` tag **(latest commit to `main`)** is: ### Supported TypeScript Version -**The version range of TypeScript currently supported by this parser is `>=3.3.1 <4.8.0`.** +**The version range of TypeScript currently supported by this parser is `>=3.3.1 <4.9.0`.** These versions are what we test against. diff --git a/_redirects b/_redirects deleted file mode 100644 index 1b61a020ea0e..000000000000 --- a/_redirects +++ /dev/null @@ -1,4 +0,0 @@ -/docs/linting /docs -/docs/linting/type-linting /docs/linting/typed-linting -/docs/linting/monorepo /docs/linting/typed-linting/monorepos -/docs/linting/tslint /docs/linting/troubleshooting/tslint diff --git a/jest.config.base.js b/jest.config.base.js index b94573bf7196..707c023f2695 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -19,6 +19,7 @@ module.exports = { 'node', ], resolver: '/../../tests/jest-resolver.js', + setupFilesAfterEnv: ['console-fail-test/setup.js'], testRegex: ['./tests/.+\\.test\\.ts$', './tests/.+\\.spec\\.ts$'], transform: { '^.+\\.(t|j)sx?$': [ diff --git a/lerna.json b/lerna.json index 5d5331a95ffa..218dac036a60 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.35.1", + "version": "5.36.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000000..7ac5b9811484 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,25 @@ +# https://docs.netlify.com/configure-builds/file-based-configuration/#build-settings +[build] + base = "" + publish = "packages/website/build" + command = "NX_VERBOSE_LOGGING=true yarn patch-package && yarn nx build website" +[build.environment] + NETLIFY_USE_YARN = "true" + YARN_FLAGS = "--ignore-scripts" + +# https://docs.netlify.com/configure-builds/file-based-configuration/#redirects +[[redirects]] + from = "/docs/linting" + to = "/docs" + +[[redirects]] + from = "/docs/linting/type-linting" + to = "/docs/linting/typed-linting" + +[[redirects]] + from = "/docs/linting/monorepo" + to = "/docs/linting/typed-linting/monorepos" + +[[redirects]] + from = "/docs/linting/tslint" + to = "/docs/linting/troubleshooting/tslint" diff --git a/package.json b/package.json index 0cb1d2997455..f73d984d8bbc 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,12 @@ "generate-contributors": "yarn ts-node --transpile-only ./tools/generate-contributors.ts", "generate-sponsors": "yarn ts-node --transpile-only ./tools/generate-sponsors.ts", "generate-website-dts": "yarn ts-node --transpile-only ./tools/generate-website-dts.ts", + "generate-lib": "nx generate-lib @typescript-eslint/scope-manager", "lint-fix": "eslint . --fix", "lint-markdown-fix": "yarn lint-markdown --fix", "lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore", "lint": "cross-env NODE_OPTIONS=\"--max-old-space-size=16384\" eslint .", - "postinstall": "yarn husky install && yarn build", + "postinstall": "yarn patch-package && yarn husky install && yarn build", "pre-commit": "yarn lint-staged", "start": "nx run website:start", "test": "nx run-many --target=test --all --parallel", @@ -73,12 +74,14 @@ "@types/rimraf": "^3.0.2", "@types/semver": "^7.3.9", "@types/tmp": "^0.2.3", + "console-fail-test": "^0.1.7", "cross-env": "^7.0.3", "cross-fetch": "^3.1.5", "cspell": "^5.20.0", - "downlevel-dts": "^0.9.0", + "downlevel-dts": ">=0.10.0", "enhanced-resolve": "^5.9.3", "eslint": "^8.15.0", + "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-plugin": "^5.0.1", "eslint-plugin-import": "^2.26.0", @@ -86,7 +89,7 @@ "eslint-plugin-simple-import-sort": "^7.0.0", "glob": "^8.0.1", "husky": "^8.0.1", - "jest": "^28.1.0", + "jest": "^29.0.1", "jest-diff": "^28.1.0", "jest-snapshot": "^28.1.0", "jest-specific-snapshot": "^5.0.0", @@ -95,16 +98,17 @@ "make-dir": "^3.1.0", "markdownlint-cli": "^0.31.1", "ncp": "^2.0.0", + "patch-package": "^6.4.7", "prettier": "2.7.1", "pretty-format": "^28.1.0", "rimraf": "^3.0.2", "tmp": "^0.2.1", "ts-node": "^10.7.0", "tslint": "^6.1.3", - "typescript": ">=3.3.1 <4.8.0" + "typescript": ">=3.3.1 <4.9.0" }, "resolutions": { - "typescript": "4.7.4", + "typescript": "4.8.2", "@types/node": "^17.0.31", "pretty-format": "^28.1.0", "//": "Pin jest to v28 across the repo", diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 32b9c1d41d39..e70c184f63e8 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/ast-spec diff --git a/packages/ast-spec/jest.config.js b/packages/ast-spec/jest.config.js index eeae64cb5dd4..6b927c0166bd 100644 --- a/packages/ast-spec/jest.config.js +++ b/packages/ast-spec/jest.config.js @@ -1,9 +1,15 @@ 'use strict'; // @ts-check + +const baseConfig = require('../../jest.config.base.js'); + /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { - ...require('../../jest.config.base.js'), + ...baseConfig, collectCoverage: false, - setupFilesAfterEnv: ['./tests/util/setupJest.ts'], + setupFilesAfterEnv: [ + ...baseConfig.setupFilesAfterEnv, + './tests/util/setupJest.ts', + ], }; diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c2c7af07a01e..53b68eea374b 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.35.1", + "version": "5.36.0", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/ast-spec/src/token/spec.ts b/packages/ast-spec/src/token/spec.ts index 45df05189eb2..3cffaf49e837 100644 --- a/packages/ast-spec/src/token/spec.ts +++ b/packages/ast-spec/src/token/spec.ts @@ -10,13 +10,4 @@ export * from './NumericToken/spec'; export * from './PunctuatorToken/spec'; export * from './RegularExpressionToken/spec'; export * from './StringToken/spec'; -export * from './TSAbstractKeyword/spec'; -export * from './TSAsyncKeyword/spec'; -export * from './TSDeclareKeyword/spec'; -export * from './TSExportKeyword/spec'; -export * from './TSPrivateKeyword/spec'; -export * from './TSProtectedKeyword/spec'; -export * from './TSPublicKeyword/spec'; -export * from './TSReadonlyKeyword/spec'; -export * from './TSStaticKeyword/spec'; export * from './TemplateToken/spec'; diff --git a/packages/ast-spec/src/token/TSAbstractKeyword/spec.ts b/packages/ast-spec/src/type/TSAbstractKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSAbstractKeyword/spec.ts rename to packages/ast-spec/src/type/TSAbstractKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSAsyncKeyword/spec.ts b/packages/ast-spec/src/type/TSAsyncKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSAsyncKeyword/spec.ts rename to packages/ast-spec/src/type/TSAsyncKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSDeclareKeyword/spec.ts b/packages/ast-spec/src/type/TSDeclareKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSDeclareKeyword/spec.ts rename to packages/ast-spec/src/type/TSDeclareKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSExportKeyword/spec.ts b/packages/ast-spec/src/type/TSExportKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSExportKeyword/spec.ts rename to packages/ast-spec/src/type/TSExportKeyword/spec.ts diff --git a/packages/ast-spec/src/type/TSIntrinsicType/spec.ts b/packages/ast-spec/src/type/TSIntrinsicKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/type/TSIntrinsicType/spec.ts rename to packages/ast-spec/src/type/TSIntrinsicKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSPrivateKeyword/spec.ts b/packages/ast-spec/src/type/TSPrivateKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSPrivateKeyword/spec.ts rename to packages/ast-spec/src/type/TSPrivateKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSProtectedKeyword/spec.ts b/packages/ast-spec/src/type/TSProtectedKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSProtectedKeyword/spec.ts rename to packages/ast-spec/src/type/TSProtectedKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSPublicKeyword/spec.ts b/packages/ast-spec/src/type/TSPublicKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSPublicKeyword/spec.ts rename to packages/ast-spec/src/type/TSPublicKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts b/packages/ast-spec/src/type/TSReadonlyKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts rename to packages/ast-spec/src/type/TSReadonlyKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSStaticKeyword/spec.ts b/packages/ast-spec/src/type/TSStaticKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSStaticKeyword/spec.ts rename to packages/ast-spec/src/type/TSStaticKeyword/spec.ts diff --git a/packages/ast-spec/src/type/spec.ts b/packages/ast-spec/src/type/spec.ts index d6209d260673..ae98ead2dc86 100644 --- a/packages/ast-spec/src/type/spec.ts +++ b/packages/ast-spec/src/type/spec.ts @@ -1,14 +1,19 @@ +export * from './TSAbstractKeyword/spec'; export * from './TSAnyKeyword/spec'; export * from './TSArrayType/spec'; +export * from './TSAsyncKeyword/spec'; export * from './TSBigIntKeyword/spec'; export * from './TSBooleanKeyword/spec'; export * from './TSConditionalType/spec'; export * from './TSConstructorType/spec'; +export * from './TSDeclareKeyword/spec'; +export * from './TSExportKeyword/spec'; export * from './TSFunctionType/spec'; export * from './TSImportType/spec'; export * from './TSIndexedAccessType/spec'; export * from './TSInferType/spec'; export * from './TSIntersectionType/spec'; +export * from './TSIntrinsicKeyword/spec'; export * from './TSLiteralType/spec'; export * from './TSMappedType/spec'; export * from './TSNamedTupleMember/spec'; @@ -17,8 +22,13 @@ export * from './TSNullKeyword/spec'; export * from './TSNumberKeyword/spec'; export * from './TSObjectKeyword/spec'; export * from './TSOptionalType/spec'; +export * from './TSPrivateKeyword/spec'; +export * from './TSProtectedKeyword/spec'; +export * from './TSPublicKeyword/spec'; export * from './TSQualifiedName/spec'; +export * from './TSReadonlyKeyword/spec'; export * from './TSRestType/spec'; +export * from './TSStaticKeyword/spec'; export * from './TSStringKeyword/spec'; export * from './TSSymbolKeyword/spec'; export * from './TSTemplateLiteralType/spec'; diff --git a/packages/ast-spec/src/unions/Modifier.ts b/packages/ast-spec/src/unions/Modifier.ts index 0922a52eca2e..f2501e6585cb 100644 --- a/packages/ast-spec/src/unions/Modifier.ts +++ b/packages/ast-spec/src/unions/Modifier.ts @@ -1,10 +1,10 @@ -import type { TSAbstractKeyword } from '../token/TSAbstractKeyword/spec'; -import type { TSAsyncKeyword } from '../token/TSAsyncKeyword/spec'; -import type { TSPrivateKeyword } from '../token/TSPrivateKeyword/spec'; -import type { TSProtectedKeyword } from '../token/TSProtectedKeyword/spec'; -import type { TSPublicKeyword } from '../token/TSPublicKeyword/spec'; -import type { TSReadonlyKeyword } from '../token/TSReadonlyKeyword/spec'; -import type { TSStaticKeyword } from '../token/TSStaticKeyword/spec'; +import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec'; +import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec'; +import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec'; +import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec'; +import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec'; +import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec'; +import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec'; export type Modifier = | TSAbstractKeyword diff --git a/packages/ast-spec/src/unions/Node.ts b/packages/ast-spec/src/unions/Node.ts index f6d4cbafffd1..6505270427b2 100644 --- a/packages/ast-spec/src/unions/Node.ts +++ b/packages/ast-spec/src/unions/Node.ts @@ -116,27 +116,22 @@ import type { TryStatement } from '../statement/TryStatement/spec'; import type { TSExportAssignment } from '../statement/TSExportAssignment/spec'; import type { WhileStatement } from '../statement/WhileStatement/spec'; import type { WithStatement } from '../statement/WithStatement/spec'; -import type { TSAbstractKeyword } from '../token/TSAbstractKeyword/spec'; -import type { TSAsyncKeyword } from '../token/TSAsyncKeyword/spec'; -import type { TSDeclareKeyword } from '../token/TSDeclareKeyword/spec'; -import type { TSExportKeyword } from '../token/TSExportKeyword/spec'; -import type { TSPrivateKeyword } from '../token/TSPrivateKeyword/spec'; -import type { TSProtectedKeyword } from '../token/TSProtectedKeyword/spec'; -import type { TSPublicKeyword } from '../token/TSPublicKeyword/spec'; -import type { TSReadonlyKeyword } from '../token/TSReadonlyKeyword/spec'; -import type { TSStaticKeyword } from '../token/TSStaticKeyword/spec'; +import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec'; import type { TSAnyKeyword } from '../type/TSAnyKeyword/spec'; import type { TSArrayType } from '../type/TSArrayType/spec'; +import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec'; import type { TSBigIntKeyword } from '../type/TSBigIntKeyword/spec'; import type { TSBooleanKeyword } from '../type/TSBooleanKeyword/spec'; import type { TSConditionalType } from '../type/TSConditionalType/spec'; import type { TSConstructorType } from '../type/TSConstructorType/spec'; +import type { TSDeclareKeyword } from '../type/TSDeclareKeyword/spec'; +import type { TSExportKeyword } from '../type/TSExportKeyword/spec'; import type { TSFunctionType } from '../type/TSFunctionType/spec'; import type { TSImportType } from '../type/TSImportType/spec'; import type { TSIndexedAccessType } from '../type/TSIndexedAccessType/spec'; import type { TSInferType } from '../type/TSInferType/spec'; import type { TSIntersectionType } from '../type/TSIntersectionType/spec'; -import type { TSIntrinsicKeyword } from '../type/TSIntrinsicType/spec'; +import type { TSIntrinsicKeyword } from '../type/TSIntrinsicKeyword/spec'; import type { TSLiteralType } from '../type/TSLiteralType/spec'; import type { TSMappedType } from '../type/TSMappedType/spec'; import type { TSNamedTupleMember } from '../type/TSNamedTupleMember/spec'; @@ -145,8 +140,13 @@ import type { TSNullKeyword } from '../type/TSNullKeyword/spec'; import type { TSNumberKeyword } from '../type/TSNumberKeyword/spec'; import type { TSObjectKeyword } from '../type/TSObjectKeyword/spec'; import type { TSOptionalType } from '../type/TSOptionalType/spec'; +import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec'; +import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec'; +import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec'; import type { TSQualifiedName } from '../type/TSQualifiedName/spec'; +import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec'; import type { TSRestType } from '../type/TSRestType/spec'; +import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec'; import type { TSStringKeyword } from '../type/TSStringKeyword/spec'; import type { TSSymbolKeyword } from '../type/TSSymbolKeyword/spec'; import type { TSTemplateLiteralType } from '../type/TSTemplateLiteralType/spec'; diff --git a/packages/ast-spec/src/unions/TypeNode.ts b/packages/ast-spec/src/unions/TypeNode.ts index 55436b7a44d4..461281cd4ce3 100644 --- a/packages/ast-spec/src/unions/TypeNode.ts +++ b/packages/ast-spec/src/unions/TypeNode.ts @@ -1,15 +1,19 @@ +import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec'; import type { TSAnyKeyword } from '../type/TSAnyKeyword/spec'; import type { TSArrayType } from '../type/TSArrayType/spec'; +import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec'; import type { TSBigIntKeyword } from '../type/TSBigIntKeyword/spec'; import type { TSBooleanKeyword } from '../type/TSBooleanKeyword/spec'; import type { TSConditionalType } from '../type/TSConditionalType/spec'; import type { TSConstructorType } from '../type/TSConstructorType/spec'; +import type { TSDeclareKeyword } from '../type/TSDeclareKeyword/spec'; +import type { TSExportKeyword } from '../type/TSExportKeyword/spec'; import type { TSFunctionType } from '../type/TSFunctionType/spec'; import type { TSImportType } from '../type/TSImportType/spec'; import type { TSIndexedAccessType } from '../type/TSIndexedAccessType/spec'; import type { TSInferType } from '../type/TSInferType/spec'; import type { TSIntersectionType } from '../type/TSIntersectionType/spec'; -import type { TSIntrinsicKeyword } from '../type/TSIntrinsicType/spec'; +import type { TSIntrinsicKeyword } from '../type/TSIntrinsicKeyword/spec'; import type { TSLiteralType } from '../type/TSLiteralType/spec'; import type { TSMappedType } from '../type/TSMappedType/spec'; import type { TSNamedTupleMember } from '../type/TSNamedTupleMember/spec'; @@ -18,7 +22,12 @@ import type { TSNullKeyword } from '../type/TSNullKeyword/spec'; import type { TSNumberKeyword } from '../type/TSNumberKeyword/spec'; import type { TSObjectKeyword } from '../type/TSObjectKeyword/spec'; import type { TSOptionalType } from '../type/TSOptionalType/spec'; +import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec'; +import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec'; +import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec'; +import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec'; import type { TSRestType } from '../type/TSRestType/spec'; +import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec'; import type { TSStringKeyword } from '../type/TSStringKeyword/spec'; import type { TSSymbolKeyword } from '../type/TSSymbolKeyword/spec'; import type { TSTemplateLiteralType } from '../type/TSTemplateLiteralType/spec'; @@ -35,12 +44,16 @@ import type { TSUnknownKeyword } from '../type/TSUnknownKeyword/spec'; import type { TSVoidKeyword } from '../type/TSVoidKeyword/spec'; export type TypeNode = + | TSAbstractKeyword | TSAnyKeyword | TSArrayType + | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType + | TSDeclareKeyword + | TSExportKeyword | TSFunctionType | TSImportType | TSIndexedAccessType @@ -55,7 +68,12 @@ export type TypeNode = | TSNumberKeyword | TSObjectKeyword | TSOptionalType + | TSPrivateKeyword + | TSProtectedKeyword + | TSPublicKeyword + | TSReadonlyKeyword | TSRestType + | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 51a81effec39..dec6c674763b 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **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 ed70ad916d99..a029c4ac5515 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "5.35.1", + "version": "5.36.0", "private": true, "main": "dist/index.js", "scripts": { @@ -14,8 +14,8 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/scope-manager": "5.35.1", - "@typescript-eslint/utils": "5.35.1", + "@typescript-eslint/scope-manager": "5.36.0", + "@typescript-eslint/utils": "5.36.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 2ee9b80302e0..7dc29a4a1c8c 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -157,7 +157,7 @@ export default createRule({ return format(code, { ...prettierConfig, parser: 'typescript', - }).trimRight(); // prettier will insert a new line at the end of the code + }).trimEnd(); // prettier will insert a new line at the end of the code } catch (ex) { // adapted from https://github.com/prettier/eslint-plugin-prettier/blob/185b1064d3dd674538456fb2fad97fbfcde49e0d/eslint-plugin-prettier.js#L242-L257 if (!(ex instanceof SyntaxError)) { @@ -282,9 +282,9 @@ export default createRule({ const lines = text.split('\n'); const lastLine = lines[lines.length - 1]; // prettier will trim out the end of line on save, but eslint will check before then - const isStartEmpty = lines[0].trimRight() === ''; + const isStartEmpty = lines[0].trimEnd() === ''; // last line can be indented - const isEndEmpty = lastLine.trimLeft() === ''; + const isEndEmpty = lastLine.trimStart() === ''; if (!isStartEmpty || !isEndEmpty) { // multiline template strings must have an empty first/last line return context.report({ diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 63165478ef89..6ab770edba5f 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **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 25f33f2b6046..3735d361ce9a 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "5.35.1", + "version": "5.36.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.35.1", + "@typescript-eslint/utils": "5.36.0", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.35.1" + "@typescript-eslint/parser": "5.36.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 572b02012b2e..b71102c4934b 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Bug Fixes + +* **eslint-plugin:** revert [#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266) ([#5564](https://github.com/typescript-eslint/typescript-eslint/issues/5564)) ([7a8afe2](https://github.com/typescript-eslint/typescript-eslint/commit/7a8afe29039c6c80fe584acaf5d933424a4452a9)) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index f236aeacd811..c7c0ea80e4f9 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -10,7 +10,7 @@ ## Getting Started -- **[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** +- **[You can find our Getting Started docs here](https://typescript-eslint.io/docs)** - **[You can find our FAQ / Troubleshooting docs here](https://typescript-eslint.io/docs/linting/troubleshooting)** These docs walk you through setting up ESLint, this plugin, and our parser. If you know what you're doing and just want to quick start, read on... diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md index 16b6d31883fa..a0ff0a0ab224 100644 --- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md @@ -1,5 +1,5 @@ --- -description: 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects.' +description: 'Enforce using concise optional chain expressions instead of chained logical ands.' --- > 🛑 This file is source code, not the primary documentation location! 🛑 @@ -65,15 +65,9 @@ foo && foo.a && foo.a.b && foo.a.b.c; foo && foo['a'] && foo['a'].b && foo['a'].b.c; foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); -// With empty objects (((foo || {}).a || {}).b || {}).c; (((foo || {})['a'] || {}).b || {}).c; -// With negated `or`s -!foo || !foo.bar; -!foo || !foo[bar]; -!foo || !foo.bar || !foo.bar.baz || !foo.bar.baz(); - // this rule also supports converting chained strict nullish checks: foo && foo.a != null && @@ -91,10 +85,6 @@ foo?.['a']?.b?.c; foo?.a?.b?.method?.(); foo?.a?.b?.c?.d?.e; - -!foo?.bar; -!foo?.[bar]; -!foo?.bar?.baz?.(); ``` **Note:** there are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 654d71a529f6..18c97280003b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.35.1", + "version": "5.36.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,9 +44,9 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.35.1", - "@typescript-eslint/type-utils": "5.35.1", - "@typescript-eslint/utils": "5.35.1", + "@typescript-eslint/scope-manager": "5.36.0", + "@typescript-eslint/type-utils": "5.36.0", + "@typescript-eslint/utils": "5.36.0", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts index 1dc876a821b3..716d625370d0 100644 --- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts +++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts @@ -15,7 +15,7 @@ const printNodeModifiers = ( ): string => `${node.accessibility ?? ''}${ node.static ? ' static' : '' - } ${final} `.trimLeft(); + } ${final} `.trimStart(); const isSupportedLiteral = ( node: TSESTree.Node, diff --git a/packages/eslint-plugin/src/rules/comma-spacing.ts b/packages/eslint-plugin/src/rules/comma-spacing.ts index ac9520440f3c..773f8689fafa 100644 --- a/packages/eslint-plugin/src/rules/comma-spacing.ts +++ b/packages/eslint-plugin/src/rules/comma-spacing.ts @@ -110,6 +110,7 @@ export default createRule({ if ( prevToken && isTokenOnSameLine(prevToken, commaToken) && + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 spaceBefore !== sourceCode.isSpaceBetweenTokens(prevToken, commaToken) ) { context.report({ @@ -139,6 +140,7 @@ export default createRule({ if ( nextToken && isTokenOnSameLine(commaToken, nextToken) && + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 spaceAfter !== sourceCode.isSpaceBetweenTokens(commaToken, nextToken) ) { context.report({ diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 8b9d82d63628..803d2679fc4a 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -4,6 +4,7 @@ import * as tsutils from 'tsutils'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; import { createRule, + getModifiers, getParserServices, InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, @@ -95,13 +96,14 @@ export default createRule({ const propertySymbol = typeChecker.getSymbolAtLocation( esTreeNodeToTSNodeMap.get(node.property), ); - const modifierKind = - propertySymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind; + const modifierKind = getModifiers( + propertySymbol?.getDeclarations()?.[0], + )?.[0].kind; if ( (allowPrivateClassPropertyAccess && - modifierKind == ts.SyntaxKind.PrivateKeyword) || + modifierKind === ts.SyntaxKind.PrivateKeyword) || (allowProtectedClassPropertyAccess && - modifierKind == ts.SyntaxKind.ProtectedKeyword) + modifierKind === ts.SyntaxKind.ProtectedKeyword) ) { return; } @@ -115,7 +117,7 @@ export default createRule({ const indexType = objectType .getNonNullableType() .getStringIndexType(); - if (indexType != undefined) { + if (indexType !== undefined) { return; } } diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index aeb4ff9146d8..2e93a8d6b92a 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -13,7 +13,6 @@ type ValidChainTarget = /* The AST is always constructed such the first element is always the deepest element. - I.e. for this code: `foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz` The AST will look like this: { @@ -34,7 +33,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects', + 'Enforce using concise optional chain expressions instead of chained logical ands', recommended: 'strict', }, hasSuggestions: true, @@ -110,81 +109,6 @@ export default util.createRule({ ], }); }, - [[ - 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > Identifier', - 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > MemberExpression', - 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > ChainExpression > MemberExpression', - ].join(',')]( - initialIdentifierOrNotEqualsExpr: - | TSESTree.Identifier - | TSESTree.MemberExpression, - ): void { - // selector guarantees this cast - const initialExpression = ( - initialIdentifierOrNotEqualsExpr.parent!.type === - AST_NODE_TYPES.ChainExpression - ? initialIdentifierOrNotEqualsExpr.parent.parent - : initialIdentifierOrNotEqualsExpr.parent - )!.parent as TSESTree.LogicalExpression; - - if ( - initialExpression.left.type !== AST_NODE_TYPES.UnaryExpression || - initialExpression.left.argument !== initialIdentifierOrNotEqualsExpr - ) { - // the node(identifier or member expression) is not the deepest left node - return; - } - - // walk up the tree to figure out how many logical expressions we can include - let previous: TSESTree.LogicalExpression = initialExpression; - let current: TSESTree.Node = initialExpression; - let previousLeftText = getText(initialIdentifierOrNotEqualsExpr); - let optionallyChainedCode = previousLeftText; - let expressionCount = 1; - while (current.type === AST_NODE_TYPES.LogicalExpression) { - if ( - current.right.type !== AST_NODE_TYPES.UnaryExpression || - !isValidChainTarget( - current.right.argument, - // only allow unary '!' with identifiers for the first chain - !foo || !foo() - expressionCount === 1, - ) - ) { - break; - } - const { rightText, shouldBreak } = breakIfInvalid({ - rightNode: current.right.argument, - previousLeftText, - }); - if (shouldBreak) { - break; - } - - ({ - expressionCount, - previousLeftText, - optionallyChainedCode, - previous, - current, - } = normalizeRepeatingPatterns( - rightText, - expressionCount, - previousLeftText, - optionallyChainedCode, - previous, - current, - )); - } - - reportIfMoreThanOne({ - expressionCount, - previous, - optionallyChainedCode, - sourceCode, - context, - shouldHandleChainedAnds: false, - }); - }, [[ 'LogicalExpression[operator="&&"] > Identifier', 'LogicalExpression[operator="&&"] > MemberExpression', @@ -229,76 +153,94 @@ export default util.createRule({ ) { break; } - const { rightText, shouldBreak } = breakIfInvalid({ - rightNode: current.right as ValidChainTarget, - previousLeftText, - }); - if (shouldBreak) { + + const leftText = previousLeftText; + const rightText = getText(current.right); + // can't just use startsWith because of cases like foo && fooBar.baz; + const matchRegex = new RegExp( + `^${ + // escape regex characters + leftText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + }[^a-zA-Z0-9_$]`, + ); + if ( + !matchRegex.test(rightText) && + // handle redundant cases like foo.bar && foo.bar + leftText !== rightText + ) { break; } - ({ - expressionCount, - previousLeftText, - optionallyChainedCode, - previous, - current, - } = normalizeRepeatingPatterns( - rightText, - expressionCount, - previousLeftText, - optionallyChainedCode, - previous, - current, - )); + // omit weird doubled up expression that make no sense like foo.bar && foo.bar + if (rightText !== leftText) { + expressionCount += 1; + previousLeftText = rightText; + + /* + Diff the left and right text to construct the fix string + There are the following cases: + 1) + rightText === 'foo.bar.baz.buzz' + leftText === 'foo.bar.baz' + diff === '.buzz' + 2) + rightText === 'foo.bar.baz.buzz()' + leftText === 'foo.bar.baz' + diff === '.buzz()' + 3) + rightText === 'foo.bar.baz.buzz()' + leftText === 'foo.bar.baz.buzz' + diff === '()' + 4) + rightText === 'foo.bar.baz[buzz]' + leftText === 'foo.bar.baz' + diff === '[buzz]' + 5) + rightText === 'foo.bar.baz?.buzz' + leftText === 'foo.bar.baz' + diff === '?.buzz' + */ + const diff = rightText.replace(leftText, ''); + if (diff.startsWith('?')) { + // item was "pre optional chained" + optionallyChainedCode += diff; + } else { + const needsDot = diff.startsWith('(') || diff.startsWith('['); + optionallyChainedCode += `?${needsDot ? '.' : ''}${diff}`; + } + } + + previous = current; + current = util.nullThrows( + current.parent, + util.NullThrowsReasons.MissingParent, + ); } - reportIfMoreThanOne({ - expressionCount, - previous, - optionallyChainedCode, - sourceCode, - context, - shouldHandleChainedAnds: true, - }); + if (expressionCount > 1) { + if (previous.right.type === AST_NODE_TYPES.BinaryExpression) { + // case like foo && foo.bar !== someValue + optionallyChainedCode += ` ${ + previous.right.operator + } ${sourceCode.getText(previous.right.right)}`; + } + + context.report({ + node: previous, + messageId: 'preferOptionalChain', + suggest: [ + { + messageId: 'optionalChainSuggest', + fix: (fixer): TSESLint.RuleFix[] => [ + fixer.replaceText(previous, optionallyChainedCode), + ], + }, + ], + }); + } }, }; - interface BreakIfInvalidResult { - leftText: string; - rightText: string; - shouldBreak: boolean; - } - - interface BreakIfInvalidOptions { - previousLeftText: string; - rightNode: ValidChainTarget; - } - - function breakIfInvalid({ - previousLeftText, - rightNode, - }: BreakIfInvalidOptions): BreakIfInvalidResult { - let shouldBreak = false; - - const rightText = getText(rightNode); - // can't just use startsWith because of cases like foo && fooBar.baz; - const matchRegex = new RegExp( - `^${ - // escape regex characters - previousLeftText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - }[^a-zA-Z0-9_$]`, - ); - if ( - !matchRegex.test(rightText) && - // handle redundant cases like foo.bar && foo.bar - previousLeftText !== rightText - ) { - shouldBreak = true; - } - return { shouldBreak, leftText: previousLeftText, rightText }; - } - function getText(node: ValidChainTarget): string { if (node.type === AST_NODE_TYPES.BinaryExpression) { return getText( @@ -445,132 +387,6 @@ const ALLOWED_NON_COMPUTED_PROP_TYPES: ReadonlySet = new Set([ AST_NODE_TYPES.Identifier, ]); -interface ReportIfMoreThanOneOptions { - expressionCount: number; - previous: TSESTree.LogicalExpression; - optionallyChainedCode: string; - sourceCode: Readonly; - context: Readonly< - TSESLint.RuleContext< - 'preferOptionalChain' | 'optionalChainSuggest', - never[] - > - >; - shouldHandleChainedAnds: boolean; -} - -function reportIfMoreThanOne({ - expressionCount, - previous, - optionallyChainedCode, - sourceCode, - context, - shouldHandleChainedAnds, -}: ReportIfMoreThanOneOptions): void { - if (expressionCount > 1) { - if ( - shouldHandleChainedAnds && - previous.right.type === AST_NODE_TYPES.BinaryExpression - ) { - // case like foo && foo.bar !== someValue - optionallyChainedCode += ` ${ - previous.right.operator - } ${sourceCode.getText(previous.right.right)}`; - } - - context.report({ - node: previous, - messageId: 'preferOptionalChain', - suggest: [ - { - messageId: 'optionalChainSuggest', - fix: (fixer): TSESLint.RuleFix[] => [ - fixer.replaceText( - previous, - `${shouldHandleChainedAnds ? '' : '!'}${optionallyChainedCode}`, - ), - ], - }, - ], - }); - } -} - -interface NormalizedPattern { - expressionCount: number; - previousLeftText: string; - optionallyChainedCode: string; - previous: TSESTree.LogicalExpression; - current: TSESTree.Node; -} - -function normalizeRepeatingPatterns( - rightText: string, - expressionCount: number, - previousLeftText: string, - optionallyChainedCode: string, - previous: TSESTree.Node, - current: TSESTree.Node, -): NormalizedPattern { - const leftText = previousLeftText; - // omit weird doubled up expression that make no sense like foo.bar && foo.bar - if (rightText !== previousLeftText) { - expressionCount += 1; - previousLeftText = rightText; - - /* - Diff the left and right text to construct the fix string - There are the following cases: - - 1) - rightText === 'foo.bar.baz.buzz' - leftText === 'foo.bar.baz' - diff === '.buzz' - - 2) - rightText === 'foo.bar.baz.buzz()' - leftText === 'foo.bar.baz' - diff === '.buzz()' - - 3) - rightText === 'foo.bar.baz.buzz()' - leftText === 'foo.bar.baz.buzz' - diff === '()' - - 4) - rightText === 'foo.bar.baz[buzz]' - leftText === 'foo.bar.baz' - diff === '[buzz]' - - 5) - rightText === 'foo.bar.baz?.buzz' - leftText === 'foo.bar.baz' - diff === '?.buzz' - */ - const diff = rightText.replace(leftText, ''); - if (diff.startsWith('?')) { - // item was "pre optional chained" - optionallyChainedCode += diff; - } else { - const needsDot = diff.startsWith('(') || diff.startsWith('['); - optionallyChainedCode += `?${needsDot ? '.' : ''}${diff}`; - } - } - - previous = current as TSESTree.LogicalExpression; - current = util.nullThrows( - current.parent, - util.NullThrowsReasons.MissingParent, - ); - return { - expressionCount, - previousLeftText, - optionallyChainedCode, - previous, - current, - }; -} - function isValidChainTarget( node: TSESTree.Node, allowIdentifier: boolean, diff --git a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts index 201c411afee8..074578acf006 100644 --- a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts +++ b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts @@ -75,9 +75,18 @@ function getGroup(node: TSESTree.TypeNode): Group { return Group.union; // These types should never occur as part of a union/intersection + case AST_NODE_TYPES.TSAbstractKeyword: + case AST_NODE_TYPES.TSAsyncKeyword: + case AST_NODE_TYPES.TSDeclareKeyword: + case AST_NODE_TYPES.TSExportKeyword: case AST_NODE_TYPES.TSNamedTupleMember: case AST_NODE_TYPES.TSOptionalType: + case AST_NODE_TYPES.TSPrivateKeyword: + case AST_NODE_TYPES.TSProtectedKeyword: + case AST_NODE_TYPES.TSPublicKeyword: + case AST_NODE_TYPES.TSReadonlyKeyword: case AST_NODE_TYPES.TSRestType: + case AST_NODE_TYPES.TSStaticKeyword: case AST_NODE_TYPES.TSTypePredicate: /* istanbul ignore next */ throw new Error(`Unexpected Type ${node.type}`); diff --git a/packages/eslint-plugin/src/rules/space-before-blocks.ts b/packages/eslint-plugin/src/rules/space-before-blocks.ts index f4d4d28ef6a3..98dd47b91fe5 100644 --- a/packages/eslint-plugin/src/rules/space-before-blocks.ts +++ b/packages/eslint-plugin/src/rules/space-before-blocks.ts @@ -46,6 +46,7 @@ export default util.createRule({ ): void { const precedingToken = sourceCode.getTokenBefore(node); if (precedingToken && util.isTokenOnSameLine(precedingToken, node)) { + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 const hasSpace = sourceCode.isSpaceBetweenTokens( precedingToken, node as TSESTree.Token, diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts index 2b34036b832a..c6e277dbf30b 100644 --- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -146,6 +146,7 @@ export default util.createRule({ rightToken = sourceCode.getFirstToken(node, util.isOpeningParenToken)!; leftToken = sourceCode.getTokenBefore(rightToken)!; } + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); if (hasSpacing && functionConfig === 'never') { diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index d10040fdf8df..cb87389b795e 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -180,6 +180,7 @@ export default util.createRule({ if (type === ':' && previousToken.value === '?') { if ( + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 sourceCode.isSpaceBetweenTokens(previousToken, punctuatorTokenStart) ) { context.report({ diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index 2151cd7b3e86..568b7e2e1b34 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -2,6 +2,7 @@ import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; import * as util from '../util'; +import { getModifiers } from '../util'; //------------------------------------------------------------------------------ // Rule Definition @@ -285,7 +286,7 @@ function checkMethod( !( ignoreStatic && tsutils.hasModifier( - valueDeclaration.modifiers, + getModifiers(valueDeclaration), ts.SyntaxKind.StaticKeyword, ) ), diff --git a/packages/eslint-plugin/src/util/index.ts b/packages/eslint-plugin/src/util/index.ts index 98ef1cf87076..b2ad2927773a 100644 --- a/packages/eslint-plugin/src/util/index.ts +++ b/packages/eslint-plugin/src/util/index.ts @@ -7,11 +7,11 @@ export * from './getFunctionHeadLoc'; export * from './getOperatorPrecedence'; export * from './getThisExpression'; export * from './getWrappingFixer'; -export * from './misc'; -export * from './objectIterators'; +export * from './isNodeEqual'; export * from './isNullLiteral'; export * from './isUndefinedIdentifier'; -export * from './isNodeEqual'; +export * from './misc'; +export * from './objectIterators'; // this is done for convenience - saves migrating all of the old rules export * from '@typescript-eslint/type-utils'; diff --git a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts index a1d8e47645a5..6f03cd731817 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts @@ -69,7 +69,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_AS_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, options: [ { assertionStyle: 'as', @@ -78,7 +78,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, options: [ { assertionStyle: 'angle-bracket', @@ -287,7 +287,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_AS_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, options: [ { assertionStyle: 'as', @@ -330,7 +330,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, options: [ { assertionStyle: 'angle-bracket', diff --git a/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts b/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts index 7cfdc209411c..f4e2f46d9982 100644 --- a/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts @@ -217,7 +217,7 @@ ruleTester.run('prefer-as-const', rule, { class foo { bar: 'baz' = 'baz'; } - `.trimRight(), + `, output: null, errors: [ { @@ -231,7 +231,7 @@ class foo { class foo { bar = 'baz' as const; } - `.trimRight(), + `, }, ], }, @@ -242,7 +242,7 @@ class foo { class foo { bar: 2 = 2; } - `.trimRight(), + `, output: null, errors: [ { @@ -256,7 +256,7 @@ class foo { class foo { bar = 2 as const; } - `.trimRight(), + `, }, ], }, @@ -267,12 +267,12 @@ class foo { class foo { foo = <'bar'>'bar'; } - `.trimRight(), + `, output: ` class foo { foo = 'bar'; } - `.trimRight(), + `, errors: [ { messageId: 'preferConstAssertion', @@ -286,12 +286,12 @@ class foo { class foo { foo = 'bar' as 'bar'; } - `.trimRight(), + `, output: ` class foo { foo = 'bar' as const; } - `.trimRight(), + `, errors: [ { messageId: 'preferConstAssertion', @@ -305,12 +305,12 @@ class foo { class foo { foo = 5 as 5; } - `.trimRight(), + `, output: ` class foo { foo = 5 as const; } - `.trimRight(), + `, errors: [ { messageId: 'preferConstAssertion', diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts index 99c8803f3fdc..289e2c83fa56 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts @@ -64,16 +64,6 @@ const baseCases = [ code: 'foo && foo[bar].baz && foo[bar].baz.buzz', output: 'foo?.[bar].baz?.buzz', }, - // case with a property access in computed property - { - code: 'foo && foo[bar.baz] && foo[bar.baz].buzz', - output: 'foo?.[bar.baz]?.buzz', - }, - // case with this keyword - { - code: 'foo[this.bar] && foo[this.bar].baz', - output: 'foo[this.bar]?.baz', - }, // chained calls { code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz()', @@ -132,11 +122,6 @@ const baseCases = [ code: 'foo.bar && foo.bar?.() && foo.bar?.().baz', output: 'foo.bar?.()?.baz', }, - // TODO: deepest left node already pre-optional chained - // { - // code: 'foo?.bar && foo.bar?.() && foo.bar?.().baz', - // output: 'foo?.bar?.()?.baz', - // }, ].map( c => ({ @@ -161,14 +146,6 @@ const baseCases = [ ruleTester.run('prefer-optional-chain', rule, { valid: [ - '!a || !b;', - '!a || a.b;', - '!a && a.b;', - '!a && !a.b;', - '!a.b || a.b?.();', - '!a.b || a.b();', - '!foo() || !foo().bar;', - 'foo || {};', 'foo || ({} as any);', '(foo || {})?.bar;', @@ -185,7 +162,6 @@ ruleTester.run('prefer-optional-chain', rule, { 'foo ?? {};', '(foo ?? {})?.bar;', 'foo ||= bar ?? {};', - 'foo && bar;', 'foo && foo;', 'foo || bar;', @@ -203,9 +179,6 @@ ruleTester.run('prefer-optional-chain', rule, { 'foo && foo[bar as string] && foo[bar as string].baz;', 'foo && foo[1 + 2] && foo[1 + 2].baz;', 'foo && foo[typeof bar] && foo[typeof bar].baz;', - // currently do not handle 'this' as the first part of a chain - 'this && this.foo;', - '!this || !this.foo;', ], invalid: [ ...baseCases, @@ -473,22 +446,6 @@ foo?.bar(/* comment */a, }, ], }, - // case with this keyword at the start of expression - { - code: 'this.bar && this.bar.baz;', - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: 'this.bar?.baz;', - }, - ], - }, - ], - }, // other weird cases { code: 'foo && foo?.();', @@ -1186,151 +1143,5 @@ foo?.bar(/* comment */a, }, ], }, - { - code: '(this || {}).foo;', - errors: [ - { - messageId: 'optionalChainSuggest', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: 'this?.foo;', - }, - ], - }, - ], - }, - ...baseCases.map(c => ({ - ...c, - code: c.code.replace(/foo/g, '!foo').replace(/&&/g, '||'), - errors: [ - { - ...c.errors[0], - suggestions: [ - { - ...c.errors[0].suggestions![0], - output: `!${c.errors[0].suggestions![0].output}`, - }, - ], - }, - ], - })), - // case with this keyword at the start of expression - { - code: '!this.bar || !this.bar.baz;', - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: '!this.bar?.baz;', - }, - ], - }, - ], - }, - { - code: '!a.b || !a.b();', - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: '!a.b?.();', - }, - ], - }, - ], - }, - { - code: '!foo.bar || !foo.bar.baz;', - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: '!foo.bar?.baz;', - }, - ], - }, - ], - }, - { - code: '!foo[bar] || !foo[bar]?.[baz];', - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: '!foo[bar]?.[baz];', - }, - ], - }, - ], - }, - { - code: '!foo || !foo?.bar.baz;', - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: '!foo?.bar.baz;', - }, - ], - }, - ], - }, - // two errors - { - code: noFormat`(!foo || !foo.bar || !foo.bar.baz) && (!baz || !baz.bar || !baz.bar.foo);`, - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: noFormat`(!foo?.bar?.baz) && (!baz || !baz.bar || !baz.bar.foo);`, - }, - ], - }, - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: noFormat`(!foo || !foo.bar || !foo.bar.baz) && (!baz?.bar?.foo);`, - }, - ], - }, - ], - }, - // TODO: deepest left node already pre-optional chained - // { - // code: '!foo?.bar || !foo?.bar.baz;', - // output: null, - // errors: [ - // { - // messageId: 'preferOptionalChain', - // suggestions: [ - // { - // messageId: 'optionalChainSuggest', - // output: '!foo?.bar?.baz;', - // }, - // ], - // }, - // ], - // }, ], }); diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 3cb1b6fb7e3c..d89c768c973c 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **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 ddd97043d2d9..a45d6f10fe99 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.35.1", + "version": "5.36.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.35.1" + "@typescript-eslint/utils": "5.36.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 9d61c1feca03..f0c039585ec3 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/README.md b/packages/parser/README.md index 3488cd5e5052..efba4854413f 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -10,7 +10,7 @@ ## Getting Started -**[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** +**[You can find our Getting Started docs here](https://typescript-eslint.io/docs)** These docs walk you through setting up ESLint, this parser, and our plugin. If you know what you're doing and just want to quick start, read on... diff --git a/packages/parser/package.json b/packages/parser/package.json index 191ddd30d9a1..9b2d0465a626 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.35.1", + "version": "5.36.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -45,9 +45,9 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.35.1", - "@typescript-eslint/types": "5.35.1", - "@typescript-eslint/typescript-estree": "5.35.1", + "@typescript-eslint/scope-manager": "5.36.0", + "@typescript-eslint/types": "5.36.0", + "@typescript-eslint/typescript-estree": "5.36.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index e1ab6fbd7408..e13a12d38d37 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/scope-manager diff --git a/packages/scope-manager/README.md b/packages/scope-manager/README.md index d51f7716ef48..b0a745f3fa53 100644 --- a/packages/scope-manager/README.md +++ b/packages/scope-manager/README.md @@ -14,7 +14,7 @@ You probably don't want to use it directly. ## Getting Started -**[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** +**[You can find our Getting Started docs here](https://typescript-eslint.io/docs)** ## Installation diff --git a/packages/scope-manager/jest.config.js b/packages/scope-manager/jest.config.js index 9148e4d46fb7..e9aff2600f8e 100644 --- a/packages/scope-manager/jest.config.js +++ b/packages/scope-manager/jest.config.js @@ -1,8 +1,14 @@ 'use strict'; // @ts-check + +const baseConfig = require('../../jest.config.base.js'); + /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { - ...require('../../jest.config.base.js'), - setupFilesAfterEnv: ['./tests/util/serializers/index.ts'], + ...baseConfig, + setupFilesAfterEnv: [ + ...baseConfig.setupFilesAfterEnv, + './tests/util/serializers/index.ts', + ], }; diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 1e407c2cd61c..b2af1281047a 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.35.1", + "version": "5.36.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -38,12 +38,12 @@ "typecheck": "cd ../../ && nx typecheck @typescript-eslint/scope-manager" }, "dependencies": { - "@typescript-eslint/types": "5.35.1", - "@typescript-eslint/visitor-keys": "5.35.1" + "@typescript-eslint/types": "5.36.0", + "@typescript-eslint/visitor-keys": "5.36.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.35.1", + "@typescript-eslint/typescript-estree": "5.36.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/scope-manager/src/lib/dom.iterable.ts b/packages/scope-manager/src/lib/dom.iterable.ts index 094303434e37..225c4f28b848 100644 --- a/packages/scope-manager/src/lib/dom.iterable.ts +++ b/packages/scope-manager/src/lib/dom.iterable.ts @@ -30,9 +30,6 @@ export const dom_iterable = { Headers: TYPE, IDBDatabase: TYPE, IDBObjectStore: TYPE, - MIDIInputMap: TYPE, - MIDIOutput: TYPE, - MIDIOutputMap: TYPE, MediaKeyStatusMap: TYPE, MediaList: TYPE, MessageEvent: TYPE, diff --git a/packages/scope-manager/src/lib/dom.ts b/packages/scope-manager/src/lib/dom.ts index e862fbc92d45..14b2143e4240 100644 --- a/packages/scope-manager/src/lib/dom.ts +++ b/packages/scope-manager/src/lib/dom.ts @@ -108,6 +108,7 @@ export const dom = { IDBDatabaseInfo: TYPE, IDBIndexParameters: TYPE, IDBObjectStoreParameters: TYPE, + IDBTransactionOptions: TYPE, IDBVersionChangeEventInit: TYPE, IIRFilterOptions: TYPE, IdleRequestOptions: TYPE, @@ -127,9 +128,6 @@ export const dom = { LockInfo: TYPE, LockManagerSnapshot: TYPE, LockOptions: TYPE, - MIDIConnectionEventInit: TYPE, - MIDIMessageEventInit: TYPE, - MIDIOptions: TYPE, MediaCapabilitiesDecodingInfo: TYPE, MediaCapabilitiesEncodingInfo: TYPE, MediaCapabilitiesInfo: TYPE, @@ -245,8 +243,8 @@ export const dom = { RTCStats: TYPE, RTCTrackEventInit: TYPE, RTCTransportStats: TYPE, - ReadableStreamDefaultReadDoneResult: TYPE, - ReadableStreamDefaultReadValueResult: TYPE, + ReadableStreamReadDoneResult: TYPE, + ReadableStreamReadValueResult: TYPE, ReadableWritablePair: TYPE, RegistrationOptions: TYPE, RequestInit: TYPE, @@ -288,6 +286,7 @@ export const dom = { ULongRange: TYPE, UnderlyingSink: TYPE, UnderlyingSource: TYPE, + ValidityStateFlags: TYPE, VideoColorSpaceInit: TYPE, VideoConfiguration: TYPE, VideoFrameMetadata: TYPE, @@ -620,17 +619,6 @@ export const dom = { Location: TYPE_VALUE, Lock: TYPE_VALUE, LockManager: TYPE_VALUE, - MIDIAccessEventMap: TYPE, - MIDIAccess: TYPE_VALUE, - MIDIConnectionEvent: TYPE_VALUE, - MIDIInputEventMap: TYPE, - MIDIInput: TYPE_VALUE, - MIDIInputMap: TYPE_VALUE, - MIDIMessageEvent: TYPE_VALUE, - MIDIOutput: TYPE_VALUE, - MIDIOutputMap: TYPE_VALUE, - MIDIPortEventMap: TYPE, - MIDIPort: TYPE_VALUE, MathMLElementEventMap: TYPE, MathMLElement: TYPE_VALUE, MediaCapabilities: TYPE_VALUE, @@ -684,11 +672,9 @@ export const dom = { NavigatorID: TYPE, NavigatorLanguage: TYPE, NavigatorLocks: TYPE, - NavigatorNetworkInformation: TYPE, NavigatorOnLine: TYPE, NavigatorPlugins: TYPE, NavigatorStorage: TYPE, - NetworkInformation: TYPE_VALUE, Node: TYPE_VALUE, NodeIterator: TYPE_VALUE, NodeList: TYPE_VALUE, @@ -781,7 +767,10 @@ export const dom = { RTCTrackEvent: TYPE_VALUE, RadioNodeList: TYPE_VALUE, Range: TYPE_VALUE, + ReadableByteStreamController: TYPE_VALUE, ReadableStream: TYPE_VALUE, + ReadableStreamBYOBReader: TYPE_VALUE, + ReadableStreamBYOBRequest: TYPE_VALUE, ReadableStreamDefaultController: TYPE_VALUE, ReadableStreamDefaultReader: TYPE_VALUE, ReadableStreamGenericReader: TYPE, @@ -1126,7 +1115,7 @@ export const dom = { OnErrorEventHandler: TYPE, PerformanceEntryList: TYPE, ReadableStreamController: TYPE, - ReadableStreamDefaultReadResult: TYPE, + ReadableStreamReadResult: TYPE, ReadableStreamReader: TYPE, RenderingContext: TYPE, RequestInfo: TYPE, @@ -1170,7 +1159,6 @@ export const dom = { ColorSpaceConversion: TYPE, CompositeOperation: TYPE, CompositeOperationOrAuto: TYPE, - ConnectionType: TYPE, CredentialMediationRequirement: TYPE, DOMParserSupportedType: TYPE, DirectionSetting: TYPE, @@ -1201,9 +1189,6 @@ export const dom = { KeyUsage: TYPE, LineAlignSetting: TYPE, LockMode: TYPE, - MIDIPortConnectionState: TYPE, - MIDIPortDeviceState: TYPE, - MIDIPortType: TYPE, MediaDecodingType: TYPE, MediaDeviceKind: TYPE, MediaEncodingType: TYPE, diff --git a/packages/scope-manager/src/lib/es2020.intl.ts b/packages/scope-manager/src/lib/es2020.intl.ts index a6ba13fec039..6cf997c0ca37 100644 --- a/packages/scope-manager/src/lib/es2020.intl.ts +++ b/packages/scope-manager/src/lib/es2020.intl.ts @@ -4,8 +4,10 @@ // npx nx generate-lib @typescript-eslint/scope-manager import { ImplicitLibVariableOptions } from '../variable'; +import { es2018_intl } from './es2018.intl'; import { TYPE_VALUE } from './base-config'; export const es2020_intl = { + ...es2018_intl, Intl: TYPE_VALUE, } as Record; diff --git a/packages/scope-manager/src/lib/es2022.intl.ts b/packages/scope-manager/src/lib/es2022.intl.ts new file mode 100644 index 000000000000..f91ef8640a0a --- /dev/null +++ b/packages/scope-manager/src/lib/es2022.intl.ts @@ -0,0 +1,11 @@ +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib @typescript-eslint/scope-manager + +import { ImplicitLibVariableOptions } from '../variable'; +import { TYPE_VALUE } from './base-config'; + +export const es2022_intl = { + Intl: TYPE_VALUE, +} as Record; diff --git a/packages/scope-manager/src/lib/es2022.sharedmemory.ts b/packages/scope-manager/src/lib/es2022.sharedmemory.ts new file mode 100644 index 000000000000..8efb4b9d8c97 --- /dev/null +++ b/packages/scope-manager/src/lib/es2022.sharedmemory.ts @@ -0,0 +1,11 @@ +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib @typescript-eslint/scope-manager + +import { ImplicitLibVariableOptions } from '../variable'; +import { TYPE } from './base-config'; + +export const es2022_sharedmemory = { + Atomics: TYPE, +} as Record; diff --git a/packages/scope-manager/src/lib/es2022.ts b/packages/scope-manager/src/lib/es2022.ts index a81f7b70b47f..6f23b9dcd570 100644 --- a/packages/scope-manager/src/lib/es2022.ts +++ b/packages/scope-manager/src/lib/es2022.ts @@ -7,13 +7,17 @@ import { ImplicitLibVariableOptions } from '../variable'; import { es2021 } from './es2021'; import { es2022_array } from './es2022.array'; import { es2022_error } from './es2022.error'; +import { es2022_intl } from './es2022.intl'; import { es2022_object } from './es2022.object'; +import { es2022_sharedmemory } from './es2022.sharedmemory'; import { es2022_string } from './es2022.string'; export const es2022 = { ...es2021, ...es2022_array, ...es2022_error, + ...es2022_intl, ...es2022_object, + ...es2022_sharedmemory, ...es2022_string, } as Record; diff --git a/packages/scope-manager/src/lib/index.ts b/packages/scope-manager/src/lib/index.ts index ab0328f7cf08..6e8e0ad73018 100644 --- a/packages/scope-manager/src/lib/index.ts +++ b/packages/scope-manager/src/lib/index.ts @@ -59,7 +59,9 @@ import { es2021_weakref } from './es2021.weakref'; import { es2021_intl } from './es2021.intl'; import { es2022_array } from './es2022.array'; import { es2022_error } from './es2022.error'; +import { es2022_intl } from './es2022.intl'; import { es2022_object } from './es2022.object'; +import { es2022_sharedmemory } from './es2022.sharedmemory'; import { es2022_string } from './es2022.string'; import { esnext_array } from './esnext.array'; import { esnext_symbol } from './esnext.symbol'; @@ -136,7 +138,9 @@ const lib = { 'es2021.intl': es2021_intl, 'es2022.array': es2022_array, 'es2022.error': es2022_error, + 'es2022.intl': es2022_intl, 'es2022.object': es2022_object, + 'es2022.sharedmemory': es2022_sharedmemory, 'es2022.string': es2022_string, 'esnext.array': esnext_array, 'esnext.symbol': esnext_symbol, diff --git a/packages/scope-manager/src/lib/webworker.ts b/packages/scope-manager/src/lib/webworker.ts index 55e4f2b58c57..4a0135864c8d 100644 --- a/packages/scope-manager/src/lib/webworker.ts +++ b/packages/scope-manager/src/lib/webworker.ts @@ -51,6 +51,7 @@ export const webworker = { IDBDatabaseInfo: TYPE, IDBIndexParameters: TYPE, IDBObjectStoreParameters: TYPE, + IDBTransactionOptions: TYPE, IDBVersionChangeEventInit: TYPE, ImageBitmapOptions: TYPE, ImageBitmapRenderingContextSettings: TYPE, @@ -87,8 +88,8 @@ export const webworker = { QueuingStrategyInit: TYPE, RTCEncodedAudioFrameMetadata: TYPE, RTCEncodedVideoFrameMetadata: TYPE, - ReadableStreamDefaultReadDoneResult: TYPE, - ReadableStreamDefaultReadValueResult: TYPE, + ReadableStreamReadDoneResult: TYPE, + ReadableStreamReadValueResult: TYPE, ReadableWritablePair: TYPE, RegistrationOptions: TYPE, RequestInit: TYPE, @@ -215,10 +216,8 @@ export const webworker = { NavigatorID: TYPE, NavigatorLanguage: TYPE, NavigatorLocks: TYPE, - NavigatorNetworkInformation: TYPE, NavigatorOnLine: TYPE, NavigatorStorage: TYPE, - NetworkInformation: TYPE_VALUE, NotificationEventMap: TYPE, Notification: TYPE_VALUE, NotificationEvent: TYPE_VALUE, @@ -254,7 +253,10 @@ export const webworker = { PushSubscriptionOptions: TYPE_VALUE, RTCEncodedAudioFrame: TYPE_VALUE, RTCEncodedVideoFrame: TYPE_VALUE, + ReadableByteStreamController: TYPE_VALUE, ReadableStream: TYPE_VALUE, + ReadableStreamBYOBReader: TYPE_VALUE, + ReadableStreamBYOBRequest: TYPE_VALUE, ReadableStreamDefaultController: TYPE_VALUE, ReadableStreamDefaultReader: TYPE_VALUE, ReadableStreamGenericReader: TYPE, @@ -390,7 +392,7 @@ export const webworker = { PerformanceEntryList: TYPE, PushMessageDataInit: TYPE, ReadableStreamController: TYPE, - ReadableStreamDefaultReadResult: TYPE, + ReadableStreamReadResult: TYPE, ReadableStreamReader: TYPE, RequestInfo: TYPE, TexImageSource: TYPE, @@ -403,7 +405,6 @@ export const webworker = { ClientTypes: TYPE, ColorGamut: TYPE, ColorSpaceConversion: TYPE, - ConnectionType: TYPE, DocumentVisibilityState: TYPE, EndingType: TYPE, FileSystemHandleKind: TYPE, diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 5c91e771597e..2f53f051ba15 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts new file mode 100644 index 000000000000..92c9258b9e04 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts @@ -0,0 +1,2 @@ +@sealed +export default class Qux {} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts new file mode 100644 index 000000000000..53ef2e4d5685 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts @@ -0,0 +1,2 @@ +@sealed +export class Qux {} diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 0a667094d6a4..c710ccabe708 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "5.35.1", + "version": "5.36.0", "private": true } diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 9d54bd642dfb..5bbc02bea313 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/type-utils diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index c9e153f70f59..dcc1e90e206c 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "5.35.1", + "version": "5.36.0", "description": "Type utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -39,12 +39,13 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.35.1", + "@typescript-eslint/typescript-estree": "5.36.0", + "@typescript-eslint/utils": "5.36.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.35.1", + "@typescript-eslint/parser": "5.36.0", "typescript": "*" }, "peerDependencies": { diff --git a/packages/type-utils/src/index.ts b/packages/type-utils/src/index.ts index 44eb35ec945b..dde032e1770c 100644 --- a/packages/type-utils/src/index.ts +++ b/packages/type-utils/src/index.ts @@ -12,3 +12,8 @@ export * from './predicates'; export * from './propertyTypes'; export * from './requiresQuoting'; export * from './typeFlagUtils'; +export { + getDecorators, + getModifiers, + typescriptVersionIsAtLeast, +} from '@typescript-eslint/typescript-estree'; diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 3badcb7b850e..441eb95a11b8 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 0d04530ab315..be92b758bb4b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.35.1", + "version": "5.36.0", "description": "Types for the TypeScript-ESTree AST spec", "keywords": [ "eslint", diff --git a/packages/types/src/lib.ts b/packages/types/src/lib.ts index 9310996e5168..0d92717fcb51 100644 --- a/packages/types/src/lib.ts +++ b/packages/types/src/lib.ts @@ -60,7 +60,9 @@ type Lib = | 'es2021.intl' | 'es2022.array' | 'es2022.error' + | 'es2022.intl' | 'es2022.object' + | 'es2022.sharedmemory' | 'es2022.string' | 'esnext.array' | 'esnext.symbol' diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index cc61cc729fef..b3adab2c9327 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 02946daa80df..cb1d0d0312c7 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -10,7 +10,7 @@ ## Getting Started -**[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** +**[You can find our Getting Started docs here](https://typescript-eslint.io/docs)** ## About diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 750141adbe21..4112568a9994 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.35.1", + "version": "5.36.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -42,8 +42,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.35.1", - "@typescript-eslint/visitor-keys": "5.35.1", + "@typescript-eslint/types": "5.36.0", + "@typescript-eslint/visitor-keys": "5.36.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "5.35.1", + "@typescript-eslint/shared-fixtures": "5.36.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 81c17185743f..4f69728b66a8 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,6 +1,7 @@ // 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, @typescript-eslint/no-unsafe-member-access */ import * as ts from 'typescript'; +import { getDecorators, getModifiers } from './getModifiers'; import { canContainDirective, createError, @@ -160,14 +161,15 @@ export class Converter { result: T, ): TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration | T { // check for exports - if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { + const modifiers = getModifiers(node); + if (modifiers?.[0].kind === SyntaxKind.ExportKeyword) { /** * Make sure that original node is registered instead of export */ this.registerTSNodeInNodeMap(node, result); - const exportKeyword = node.modifiers[0]; - const nextModifier = node.modifiers[1]; + const exportKeyword = modifiers[0]; + const nextModifier = modifiers[1]; const declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword; @@ -408,10 +410,9 @@ export class Converter { return parameters.map(param => { const convertedParam = this.convertChild(param) as TSESTree.Parameter; - if (param.decorators?.length) { - convertedParam.decorators = param.decorators.map(el => - this.convertChild(el), - ); + const decorators = getDecorators(param); + if (decorators?.length) { + convertedParam.decorators = decorators.map(el => this.convertChild(el)); } return convertedParam; }); @@ -509,17 +510,38 @@ export class Converter { ) : null; } - if ('decorators' in node && node.decorators && node.decorators.length) { - result.decorators = node.decorators.map(el => this.convertChild(el)); + const decorators = getDecorators(node); + if (decorators?.length) { + result.decorators = decorators.map(el => this.convertChild(el)); } + // keys we never want to clone from the base typescript node as they + // introduce garbage into our AST + const KEYS_TO_NOT_COPY = new Set([ + '_children', + 'decorators', + 'end', + 'flags', + 'illegalDecorators', + 'heritageClauses', + 'locals', + 'localSymbol', + 'jsDoc', + 'kind', + 'modifierFlagsCache', + 'modifiers', + 'nextContainer', + 'parent', + 'pos', + 'symbol', + 'transformFlags', + 'type', + 'typeArguments', + 'typeParameters', + ]); + Object.entries(node) - .filter( - ([key]) => - !/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc|type|typeArguments|typeParameters|decorators|transformFlags)$/.test( - key, - ), - ) + .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) .forEach(([key, value]) => { if (Array.isArray(value)) { result[key] = value.map(el => this.convertChild(el as TSNode)); @@ -679,18 +701,21 @@ export class Converter { /** * Applies the given TS modifiers to the given result object. + * + * This method adds not standardized `modifiers` property in nodes + * * @param result * @param modifiers original ts.Nodes from the node.modifiers array * @returns the current result object will be mutated - * @deprecated This method adds not standardized `modifiers` property in nodes */ private applyModifiersToResult( result: TSESTree.TSEnumDeclaration | TSESTree.TSModuleDeclaration, - modifiers?: ts.ModifiersArray, + modifiers: Iterable | undefined, ): void { - if (!modifiers?.length) { + if (!modifiers) { return; } + const remainingModifiers: TSESTree.Modifier[] = []; /** * Some modifiers are explicitly handled by applying them as @@ -725,7 +750,7 @@ export class Converter { * not been explicitly handled above, we just convert and * add the modifiers array to the result node. */ - if (remainingModifiers.length) { + if (remainingModifiers.length > 0) { result.modifiers = remainingModifiers; } } @@ -1034,8 +1059,9 @@ export class Converter { * but the TypeScript compiler will parse them and produce a valid AST, * so we handle them here too. */ - if (node.decorators) { - (result as any).decorators = node.decorators.map(el => + const decorators = getDecorators(node); + if (decorators) { + (result as any).decorators = decorators.map(el => this.convertChild(el), ); } @@ -1167,8 +1193,9 @@ export class Converter { result.typeAnnotation = this.convertTypeAnnotation(node.type, node); } - if (node.decorators) { - result.decorators = node.decorators.map(el => this.convertChild(el)); + const decorators = getDecorators(node); + if (decorators) { + result.decorators = decorators.map(el => this.convertChild(el)); } const accessibility = getTSNodeAccessibility(node); @@ -1281,10 +1308,9 @@ export class Converter { override: hasModifier(SyntaxKind.OverrideKeyword, node), }); - if (node.decorators) { - result.decorators = node.decorators.map(el => - this.convertChild(el), - ); + const decorators = getDecorators(node); + if (decorators) { + result.decorators = decorators.map(el => this.convertChild(el)); } const accessibility = getTSNodeAccessibility(node); @@ -1618,7 +1644,8 @@ export class Converter { right: this.convertChild(node.initializer), }); - if (node.modifiers) { + const modifiers = getModifiers(node); + if (modifiers) { // AssignmentPattern should not contain modifiers in range result.range[0] = parameter.range[0]; result.loc = getLocFor(result.range[0], result.range[1], this.ast); @@ -1646,7 +1673,13 @@ export class Converter { parameter.optional = true; } - if (node.modifiers) { + const decorators = getDecorators(node); + if (decorators) { + parameter.decorators = decorators.map(d => this.convertChild(d)); + } + + const modifiers = getModifiers(node); + if (modifiers) { return this.createNode(node, { type: AST_NODE_TYPES.TSParameterProperty, accessibility: getTSNodeAccessibility(node) ?? undefined, @@ -1737,8 +1770,9 @@ export class Converter { result.declare = true; } - if (node.decorators) { - result.decorators = node.decorators.map(el => this.convertChild(el)); + const decorators = getDecorators(node); + if (decorators) { + result.decorators = decorators.map(el => this.convertChild(el)); } const filteredMembers = node.members.filter(isESTreeClassMember); @@ -2511,7 +2545,11 @@ export class Converter { typeAnnotation: node.type ? this.convertTypeAnnotation(node.type, node) : undefined, - initializer: this.convertChild(node.initializer) || undefined, + initializer: + this.convertChild( + // eslint-disable-next-line deprecation/deprecation -- TODO breaking change remove this from the AST + node.initializer, + ) || undefined, readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: hasModifier(SyntaxKind.StaticKeyword, node) || undefined, export: hasModifier(SyntaxKind.ExportKeyword, node) || undefined, @@ -2725,7 +2763,7 @@ export class Converter { members: node.members.map(el => this.convertChild(el)), }); // apply modifiers first... - this.applyModifiersToResult(result, node.modifiers); + this.applyModifiersToResult(result, getModifiers(node)); // ...then check for exports return this.fixExports(node, result); } @@ -2753,7 +2791,7 @@ export class Converter { result.body = this.convertChild(node.body); } // apply modifiers first... - this.applyModifiersToResult(result, node.modifiers); + this.applyModifiersToResult(result, getModifiers(node)); if (node.flags & ts.NodeFlags.GlobalAugmentation) { result.global = true; } diff --git a/packages/typescript-estree/src/getModifiers.ts b/packages/typescript-estree/src/getModifiers.ts new file mode 100644 index 000000000000..24f119f9e8ae --- /dev/null +++ b/packages/typescript-estree/src/getModifiers.ts @@ -0,0 +1,52 @@ +import * as ts from 'typescript'; +import { typescriptVersionIsAtLeast } from './version-check'; + +const isAtLeast48 = typescriptVersionIsAtLeast['4.8']; + +export function getModifiers( + node: ts.Node | null | undefined, +): undefined | ts.Modifier[] { + if (node == null) { + return undefined; + } + + if (isAtLeast48) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + if (ts.canHaveModifiers(node)) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + const modifiers = ts.getModifiers(node); + return modifiers ? Array.from(modifiers) : undefined; + } + + return undefined; + } + + return ( + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for older TS versions + node.modifiers?.filter((m): m is ts.Modifier => !ts.isDecorator(m)) + ); +} + +export function getDecorators( + node: ts.Node | null | undefined, +): undefined | ts.Decorator[] { + if (node == undefined) { + return undefined; + } + + if (isAtLeast48) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + if (ts.canHaveDecorators(node)) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + const decorators = ts.getDecorators(node); + return decorators ? Array.from(decorators) : undefined; + } + + return undefined; + } + + return ( + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for older TS versions + node.modifiers?.filter(ts.isDecorator) + ); +} diff --git a/packages/typescript-estree/src/index.ts b/packages/typescript-estree/src/index.ts index fda8b30032f5..48c9fb1ab88a 100644 --- a/packages/typescript-estree/src/index.ts +++ b/packages/typescript-estree/src/index.ts @@ -13,6 +13,8 @@ export * from './ts-estree'; export { clearWatchCaches as clearCaches } from './create-program/createWatchProgram'; export { createProgramFromConfigFile as createProgram } from './create-program/useProvidedPrograms'; export * from './create-program/getScriptKind'; +export { typescriptVersionIsAtLeast } from './version-check'; +export * from './getModifiers'; // re-export for backwards-compat export { visitorKeys } from '@typescript-eslint/visitor-keys'; diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 1f7b75651d51..7412704f3e14 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -1,6 +1,7 @@ import * as ts from 'typescript'; import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from './ts-estree'; import { xhtmlEntities } from './jsx/xhtml-entities'; +import { getModifiers } from './getModifiers'; const SyntaxKind = ts.SyntaxKind; @@ -80,11 +81,8 @@ export function hasModifier( modifierKind: ts.KeywordSyntaxKind, node: ts.Node, ): boolean { - return ( - !!node.modifiers && - !!node.modifiers.length && - node.modifiers.some(modifier => modifier.kind === modifierKind) - ); + const modifiers = getModifiers(node); + return modifiers?.some(modifier => modifier.kind === modifierKind) === true; } /** @@ -93,12 +91,11 @@ export function hasModifier( * @returns returns last modifier if present or null */ export function getLastModifier(node: ts.Node): ts.Modifier | null { - return ( - (!!node.modifiers && - !!node.modifiers.length && - node.modifiers[node.modifiers.length - 1]) || - null - ); + const modifiers = getModifiers(node); + if (modifiers == null) { + return null; + } + return modifiers[modifiers.length - 1] ?? null; } /** @@ -274,8 +271,8 @@ export function getDeclarationKind( export function getTSNodeAccessibility( node: ts.Node, ): 'public' | 'protected' | 'private' | null { - const modifiers = node.modifiers; - if (!modifiers) { + const modifiers = getModifiers(node); + if (modifiers == null) { return null; } for (const modifier of modifiers) { diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index f734c402eeb0..765de3978280 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -30,7 +30,7 @@ const log = debug('typescript-eslint:typescript-estree:parser'); * This needs to be kept in sync with the top-level README.md in the * typescript-eslint monorepo */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.8.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.9.0'; /* * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one * List them all separately here, so we can automatically create the full string diff --git a/packages/typescript-estree/src/version-check.ts b/packages/typescript-estree/src/version-check.ts index d26f96bc31a8..194636cb5870 100644 --- a/packages/typescript-estree/src/version-check.ts +++ b/packages/typescript-estree/src/version-check.ts @@ -12,11 +12,18 @@ function semverCheck(version: string): boolean { } const versions = [ - // '3.7', '3.8', '3.9', '4.0', + '4.1', + '4.2', + '4.3', + '4.4', + '4.5', + '4.6', + '4.7', + '4.8', ] as const; type Versions = typeof versions extends ArrayLike ? U : never; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 850ac470fadb..10c42e4dd022 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -24,7 +24,7 @@ interface CreateFixturePatternConfig { } const fixturesDirPath = path.join(__dirname, '../fixtures'); -const sharedFixturesDirPath = path.join( +export const sharedFixturesDirPath = path.join( __dirname, '../../../shared-fixtures/fixtures', ); @@ -437,6 +437,14 @@ tester.addFixturePatternConfig('typescript/decorators/accessor-decorators', { }); tester.addFixturePatternConfig('typescript/decorators/class-decorators', { fileType: 'ts', + ignore: [ + /** + * babel sets the range of the export node to the start of the decorator + * TSESTree sets it to the start of the export keyword + */ + 'export-default-class-decorator', + 'export-named-class-decorator', + ], }); tester.addFixturePatternConfig('typescript/decorators/method-decorators', { fileType: 'ts', diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 57ab33710bee..3047c124f651 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; +import path from 'path'; import type { File } from '@babel/types'; -import { fixturesToTest } from './fixtures-to-test'; +import { fixturesToTest, sharedFixturesDirPath } from './fixtures-to-test'; import { parse } from './parse'; import { preprocessBabylonAST, @@ -70,22 +71,23 @@ fixturesToTest.forEach(fixture => { /** * No errors, assert the two ASTs match */ - it(`${filename}`, () => { + const relativeFilename = path.relative(sharedFixturesDirPath, filename); + it(`${relativeFilename}`, () => { expect(babelParserResult.ast).toBeTruthy(); expect(typeScriptESTreeResult.ast).toBeTruthy(); /** * Perform some extra formatting steps on the babel AST before comparing */ - expect( - removeLocationDataAndSourceTypeFromProgramNode( - preprocessBabylonAST(babelParserResult.ast as File), - fixture.ignoreSourceType, - ), - ).toEqual( - removeLocationDataAndSourceTypeFromProgramNode( - preprocessTypescriptAST(typeScriptESTreeResult.ast), - fixture.ignoreSourceType, - ), + const babelAst = removeLocationDataAndSourceTypeFromProgramNode( + preprocessBabylonAST(babelParserResult.ast as File), + fixture.ignoreSourceType, ); + const tsestreeAst = removeLocationDataAndSourceTypeFromProgramNode( + preprocessTypescriptAST(typeScriptESTreeResult.ast), + fixture.ignoreSourceType, + ); + + // Received = Babel, Expected = TSESTree + expect(babelAst).toEqual(tsestreeAst); }); }); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap index 0f40740978e1..db90bccee686 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -189,9 +189,6 @@ Object { "line": 1, }, }, - "localSymbol": undefined, - "locals": undefined, - "modifiers": undefined, "name": Object { "escapedText": "foo", "loc": Object { @@ -211,12 +208,10 @@ Object { ], "type": "TSUnparsedPrologue", }, - "nextContainer": undefined, "range": Array [ 0, 35, ], - "symbol": undefined, "type": "TSUnparsedPrologue", "typeAnnotation": null, "typeParameters": null, @@ -280,7 +275,6 @@ Object { "type": "Decorator", }, ], - "heritageClauses": undefined, "loc": Object { "end": Object { "column": 18, @@ -291,10 +285,7 @@ Object { "line": 1, }, }, - "localSymbol": undefined, - "locals": undefined, "members": Array [], - "modifiers": undefined, "name": Object { "loc": Object { "end": Object { @@ -313,12 +304,10 @@ Object { ], "type": "Identifier", }, - "nextContainer": undefined, "range": Array [ 0, 18, ], - "symbol": undefined, "type": "TSClassDeclaration", "typeParameters": null, } @@ -420,7 +409,6 @@ Object { exports[`convert deeplyCopy should convert node with type parameters correctly 1`] = ` Object { - "heritageClauses": undefined, "loc": Object { "end": Object { "column": 15, @@ -431,10 +419,7 @@ Object { "line": 1, }, }, - "localSymbol": undefined, - "locals": undefined, "members": Array [], - "modifiers": undefined, "name": Object { "loc": Object { "end": Object { @@ -453,12 +438,10 @@ Object { ], "type": "Identifier", }, - "nextContainer": undefined, "range": Array [ 0, 15, ], - "symbol": undefined, "type": "TSClassDeclaration", "typeParameters": Object { "loc": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 6cabb17f5166..5b2338cd4c36 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -1346,10 +1346,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-tags.src 1`] = ` TSError { - "column": 16, - "index": 16, + "column": 40, + "index": 40, "lineNumber": 1, - "message": "'{' expected.", + "message": "Unexpected token. Did you mean \`{'>'}\` or \`>\`?", } `; @@ -1368,7 +1368,7 @@ TSError { "column": 5, "index": 5, "lineNumber": 1, - "message": "'{' expected.", + "message": "'{' or JSX element expected.", } `; @@ -2224,6 +2224,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index ad60019b2004..5bd3c5670cbe 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -1,5 +1,4 @@ -// deeplyCopy is private internal -/* eslint-disable @typescript-eslint/no-explicit-any */ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; import * as ts from 'typescript'; import type { TSNode } from '../../src'; import { Converter } from '../../src/convert'; @@ -39,9 +38,11 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; + }); - expect(instance.deeplyCopy(ast.statements[0])).toMatchSnapshot(); + expect( + instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), + ).toMatchSnapshot(); }); it('deeplyCopy should convert node with type parameters correctly', () => { @@ -50,9 +51,11 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; + }); - expect(instance.deeplyCopy(ast.statements[0])).toMatchSnapshot(); + expect( + instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), + ).toMatchSnapshot(); }); it('deeplyCopy should convert node with type arguments correctly', () => { @@ -61,10 +64,13 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; + }); expect( - instance.deeplyCopy((ast.statements[0] as any).expression), + instance['deeplyCopy']( + (ast.statements[0] as ts.ExpressionStatement) + .expression as ts.NewExpression, + ), ).toMatchSnapshot(); }); @@ -74,8 +80,8 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; - expect(instance.deeplyCopy(ast)).toMatchSnapshot(); + }); + expect(instance['deeplyCopy'](ast)).toMatchSnapshot(); }); it('deeplyCopy should fail on unknown node', () => { @@ -84,9 +90,9 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: true, shouldPreserveNodeMaps: false, - }) as any; + }); - expect(() => instance.deeplyCopy(ast)).toThrow( + expect(() => instance['deeplyCopy'](ast)).toThrow( 'Unknown AST_NODE_TYPE: "TSSourceFile"', ); }); @@ -200,8 +206,13 @@ describe('convert', () => { shouldPreserveNodeMaps: true, }); - const tsNode = ts.createNode(ts.SyntaxKind.AsKeyword, 0, 10); - const convertedNode = (instance as any).createNode(tsNode, { + const tsNode: ts.KeywordToken = { + ...ts.factory.createToken(ts.SyntaxKind.AbstractKeyword), + end: 10, + pos: 0, + }; + const convertedNode = instance['createNode'](tsNode, { + type: AST_NODE_TYPES.TSAbstractKeyword, range: [0, 20], loc: { start: { @@ -215,17 +226,18 @@ describe('convert', () => { }, }); expect(convertedNode).toEqual({ + type: AST_NODE_TYPES.TSAbstractKeyword, + range: [0, 20], loc: { - end: { - column: 25, - line: 15, - }, start: { - column: 20, line: 10, + column: 20, + }, + end: { + line: 15, + column: 25, }, }, - range: [0, 20], }); }); diff --git a/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot b/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot index d778d382e997..02c6e82f6632 100644 --- a/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot @@ -2,9 +2,9 @@ exports[`jsx embedded-tags.src 1`] = ` TSError { - "column": 16, - "index": 16, + "column": 40, + "index": 40, "lineNumber": 1, - "message": "'{' expected.", + "message": "Unexpected token. Did you mean \`{'>'}\` or \`>\`?", } `; diff --git a/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot b/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot index b0eaf47f8e9e..0a637a762554 100644 --- a/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot @@ -5,6 +5,6 @@ TSError { "column": 5, "index": 5, "lineNumber": 1, - "message": "'{' expected.", + "message": "'{' or JSX element expected.", } `; diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-default-class-decorator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-default-class-decorator.src.ts.shot new file mode 100644 index 000000000000..031962dfb273 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-default-class-decorator.src.ts.shot @@ -0,0 +1,280 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript decorators class-decorators export-default-class-decorator.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sealed", + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "Qux", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 23, + 35, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "exportKind": "value", + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 35, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + "value": "sealed", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 22, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "Qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-named-class-decorator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-named-class-decorator.src.ts.shot new file mode 100644 index 000000000000..f3b1a4c1ed53 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-named-class-decorator.src.ts.shot @@ -0,0 +1,265 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript decorators class-decorators export-named-class-decorator.src 1`] = ` +Object { + "body": Array [ + Object { + "assertions": Array [], + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 25, + 27, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sealed", + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "Qux", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 27, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "exportKind": "value", + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 27, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + "value": "sealed", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "Qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot index aa52b8264e80..da9ce1e5a237 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot @@ -60,62 +60,6 @@ Object { "type": "VariableDeclarator", }, ], - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "deco", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "optional": false, - "range": Array [ - 1, - 7, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 7, - ], - "type": "Decorator", - }, - ], "kind": "const", "loc": Object { "end": Object { diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 01cc49d591ff..f81c77590ab1 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/utils diff --git a/packages/utils/package.json b/packages/utils/package.json index 947a84c82f0b..0c4d123de252 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "5.35.1", + "version": "5.36.0", "description": "Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.35.1", - "@typescript-eslint/types": "5.35.1", - "@typescript-eslint/typescript-estree": "5.35.1", + "@typescript-eslint/scope-manager": "5.36.0", + "@typescript-eslint/types": "5.36.0", + "@typescript-eslint/typescript-estree": "5.36.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/utils/src/ast-utils/helpers.ts b/packages/utils/src/ast-utils/helpers.ts index fa2b8bb9f5cb..1c29164991de 100644 --- a/packages/utils/src/ast-utils/helpers.ts +++ b/packages/utils/src/ast-utils/helpers.ts @@ -1,75 +1,74 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree'; -type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]]; +type ObjectEntry = BaseType extends unknown + ? [keyof BaseType, BaseType[keyof BaseType]] + : never; type ObjectEntries = Array>; export const isNodeOfType = (nodeType: NodeType) => ( node: TSESTree.Node | null | undefined, - ): node is TSESTree.Node & { type: NodeType } => + ): node is Extract => node?.type === nodeType; export const isNodeOfTypes = (nodeTypes: NodeTypes) => ( node: TSESTree.Node | null | undefined, - ): node is TSESTree.Node & { type: NodeTypes[number] } => + ): node is Extract => !!node && nodeTypes.includes(node.type); export const isNodeOfTypeWithConditions = < NodeType extends AST_NODE_TYPES, - Conditions extends Partial, + ExtractedNode extends Extract, + Conditions extends Partial, >( nodeType: NodeType, conditions: Conditions, ): (( node: TSESTree.Node | null | undefined, -) => node is TSESTree.Node & { type: NodeType } & Conditions) => { +) => node is ExtractedNode & Conditions) => { const entries = Object.entries(conditions) as ObjectEntries; return ( node: TSESTree.Node | null | undefined, - ): node is TSESTree.Node & { type: NodeType } & Conditions => + ): node is ExtractedNode & Conditions => node?.type === nodeType && - entries.every(([key, value]) => node[key] === value); + entries.every(([key, value]) => node[key as keyof TSESTree.Node] === value); }; export const isTokenOfTypeWithConditions = < TokenType extends AST_TOKEN_TYPES, + ExtractedToken extends Extract, Conditions extends Partial, >( tokenType: TokenType, conditions: Conditions, ): (( token: TSESTree.Token | null | undefined, -) => token is TSESTree.Token & { type: TokenType } & Conditions) => { +) => token is ExtractedToken & Conditions) => { const entries = Object.entries(conditions) as ObjectEntries; return ( token: TSESTree.Token | null | undefined, - ): token is TSESTree.Token & { type: TokenType } & Conditions => + ): token is ExtractedToken & Conditions => token?.type === tokenType && - entries.every(([key, value]) => token[key] === value); + entries.every( + ([key, value]) => token[key as keyof TSESTree.Token] === value, + ); }; export const isNotTokenOfTypeWithConditions = < TokenType extends AST_TOKEN_TYPES, - Conditions extends Partial, + ExtractedToken extends Extract, + Conditions extends Partial, >( tokenType: TokenType, conditions: Conditions, ): (( token: TSESTree.Token | null | undefined, - ) => token is Exclude< - TSESTree.Token, - TSESTree.Token & { type: TokenType } & Conditions - >) => - ( - token, - ): token is Exclude< - TSESTree.Token, - TSESTree.Token & { type: TokenType } & Conditions - > => + ) => token is Exclude) => + (token): token is Exclude => !isTokenOfTypeWithConditions(tokenType, conditions)(token); diff --git a/packages/utils/src/ts-eslint/CLIEngine.ts b/packages/utils/src/ts-eslint/CLIEngine.ts index 9cc1c97b5c79..e8db733d9f59 100644 --- a/packages/utils/src/ts-eslint/CLIEngine.ts +++ b/packages/utils/src/ts-eslint/CLIEngine.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable deprecation/deprecation -- "uses" deprecated API to define the deprecated API */ import { CLIEngine as ESLintCLIEngine } from 'eslint'; import { Linter } from './Linter'; diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index de96d725e58b..4adde0215cc7 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **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 36fc7c25cc2d..c98aa9a12475 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.35.1", + "version": "5.36.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -39,7 +39,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.35.1", + "@typescript-eslint/types": "5.36.0", "eslint-visitor-keys": "^3.3.0" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index b3ffa09c3e47..1b80cf2efd03 100644 --- a/packages/website-eslint/CHANGELOG.md +++ b/packages/website-eslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + +**Note:** Version bump only for package @typescript-eslint/website-eslint + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/website-eslint diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 91cc7e5154d0..3d9ed5eef5a0 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.35.1", + "version": "5.36.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,19 +16,19 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.35.1", - "@typescript-eslint/utils": "5.35.1" + "@typescript-eslint/types": "5.36.0", + "@typescript-eslint/utils": "5.36.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", "@rollup/pluginutils": "^4.2.1", - "@typescript-eslint/eslint-plugin": "5.35.1", - "@typescript-eslint/parser": "5.35.1", - "@typescript-eslint/scope-manager": "5.35.1", - "@typescript-eslint/typescript-estree": "5.35.1", - "@typescript-eslint/visitor-keys": "5.35.1", + "@typescript-eslint/eslint-plugin": "5.36.0", + "@typescript-eslint/parser": "5.36.0", + "@typescript-eslint/scope-manager": "5.36.0", + "@typescript-eslint/typescript-estree": "5.36.0", + "@typescript-eslint/visitor-keys": "5.36.0", "eslint": "*", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index d10208f84ea6..bf0cb173ad36 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) + + +### Features + +* support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) + + + + + ## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index a416ca02959a..e2b44dc38490 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -129,7 +129,7 @@ }, { "id": "Sourcegraph", - "image": "https://images.opencollective.com/sourcegraph/8587b83/logo.png", + "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", "name": "Sourcegraph", "tier": "contributor", "totalDonations": 20000, diff --git a/packages/website/package.json b/packages/website/package.json index 2619fa327acc..47006323ad0a 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "5.35.1", + "version": "5.36.0", "private": true, "scripts": { "build": "docusaurus build", @@ -20,8 +20,8 @@ "@docusaurus/remark-plugin-npm2yarn": "~2.0.1", "@docusaurus/theme-common": "~2.0.1", "@mdx-js/react": "1.6.22", - "@typescript-eslint/parser": "5.35.1", - "@typescript-eslint/website-eslint": "5.35.1", + "@typescript-eslint/parser": "5.36.0", + "@typescript-eslint/website-eslint": "5.36.0", "clsx": "^1.1.1", "eslint": "*", "json-schema": "^0.4.0", @@ -41,7 +41,7 @@ "@types/react": "^18.0.9", "@types/react-helmet": "^6.1.5", "@types/react-router-dom": "^5.3.3", - "@typescript-eslint/eslint-plugin": "5.35.1", + "@typescript-eslint/eslint-plugin": "5.36.0", "copy-webpack-plugin": "^11.0.0", "cypress": "8.3.0", "cypress-axe": "^0.14.0", diff --git a/packages/website/src/components/modals/Modal.tsx b/packages/website/src/components/modals/Modal.tsx index 6e95d4ea8586..535942f88b52 100644 --- a/packages/website/src/components/modals/Modal.tsx +++ b/packages/website/src/components/modals/Modal.tsx @@ -14,7 +14,11 @@ interface ModalProps { function Modal(props: ModalProps): JSX.Element { useEffect(() => { const closeOnEscapeKeyDown = (e: KeyboardEvent): void => { - if (e.key === 'Escape' || e.keyCode === 27) { + if ( + e.key === 'Escape' || + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for old browsers + e.keyCode === 27 + ) { props.onClose(); } }; diff --git a/patches/tsutils+3.21.0.patch b/patches/tsutils+3.21.0.patch new file mode 100644 index 000000000000..0b2e3ee10360 --- /dev/null +++ b/patches/tsutils+3.21.0.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/tsutils/util/util.d.ts b/node_modules/tsutils/util/util.d.ts +index 97cedda..4a63900 100644 +--- a/node_modules/tsutils/util/util.d.ts ++++ b/node_modules/tsutils/util/util.d.ts +@@ -9,7 +9,7 @@ export declare function isJsDocKind(kind: ts.SyntaxKind): boolean; + export declare function isKeywordKind(kind: ts.SyntaxKind): boolean; + export declare function isThisParameter(parameter: ts.ParameterDeclaration): boolean; + export declare function getModifier(node: ts.Node, kind: ts.Modifier['kind']): ts.Modifier | undefined; +-export declare function hasModifier(modifiers: ts.ModifiersArray | undefined, ...kinds: Array): boolean; ++export declare function hasModifier(modifiers: Iterable | undefined, ...kinds: Array): boolean; + export declare function isParameterProperty(node: ts.ParameterDeclaration): boolean; + export declare function hasAccessModifier(node: ts.ClassElement | ts.ParameterDeclaration): boolean; + export declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean; diff --git a/patches/typescript+4.8.2.patch b/patches/typescript+4.8.2.patch new file mode 100644 index 000000000000..42f28d47ece1 --- /dev/null +++ b/patches/typescript+4.8.2.patch @@ -0,0 +1,42 @@ +diff --git a/node_modules/typescript/lib/typescript.d.ts b/node_modules/typescript/lib/typescript.d.ts +index 0fd60ae..b3610b8 100644 +--- a/node_modules/typescript/lib/typescript.d.ts ++++ b/node_modules/typescript/lib/typescript.d.ts +@@ -425,8 +425,8 @@ declare namespace ts { + JSDocFunctionType = 317, + JSDocVariadicType = 318, + JSDocNamepathType = 319, ++ /** @deprecated This was only added in 4.7 */ + JSDoc = 320, +- /** @deprecated Use SyntaxKind.JSDoc */ + JSDocComment = 320, + JSDocText = 321, + JSDocTypeLiteral = 322, +@@ -4374,7 +4374,13 @@ declare namespace ts { + function symbolName(symbol: Symbol): string; + function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; + function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`. ++ */ + function getDecorators(node: HasDecorators): readonly Decorator[] | undefined; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`. ++ */ + function getModifiers(node: HasModifiers): readonly Modifier[] | undefined; + /** + * Gets the JSDoc parameter tags for the node if present. +@@ -4834,7 +4840,13 @@ declare namespace ts { + } + declare namespace ts { + function setTextRange(range: T, location: TextRange | undefined): T; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`. ++ */ + function canHaveModifiers(node: Node): node is HasModifiers; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`. ++ */ + function canHaveDecorators(node: Node): node is HasDecorators; + } + declare namespace ts { diff --git a/yarn.lock b/yarn.lock index 1a6959cc55a5..4e6e6b896f97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2020,7 +2020,7 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.1.1", "@jest/console@^28.1.3": +"@jest/console@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.3.tgz#2030606ec03a18c31803b8a36382762e447655df" integrity sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw== @@ -2032,38 +2032,49 @@ jest-util "^28.1.3" slash "^3.0.0" -"@jest/core@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.1.tgz#086830bec6267accf9af5ca76f794858e9f9f092" - integrity sha512-3pYsBoZZ42tXMdlcFeCc/0j9kOlK7MYuXs2B1QbvDgMoW1K9NJ4G/VYvIbMb26iqlkTfPHo7SC2JgjDOk/mxXw== - dependencies: - "@jest/console" "^28.1.1" - "@jest/reporters" "^28.1.1" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" - "@jest/types" "^28.1.1" +"@jest/console@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.1.tgz#e0e429cfc89900e3a46ce27f493bf488395ade39" + integrity sha512-SxLvSKf9gk4Rvt3p2KRQWVQ3sVj7S37rjlCHwp2+xNcRO/X+Uw0idbkfOtciUpjghHIxyggqcrrKhThQ+vClLQ== + dependencies: + "@jest/types" "^29.0.1" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.0.1" + jest-util "^29.0.1" + slash "^3.0.0" + +"@jest/core@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.1.tgz#a49517795f692a510b6fae55a9c09e659826c472" + integrity sha512-EcFrXkYh8I1GYHRH9V4TU7jr4P6ckaPqGo/z4AIJjHDZxicjYgWB6fx1xFb5bhEM87eUjCF4FAY5t+RamLWQmA== + dependencies: + "@jest/console" "^29.0.1" + "@jest/reporters" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^28.0.2" - jest-config "^28.1.1" - jest-haste-map "^28.1.1" - jest-message-util "^28.1.1" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.1" - jest-resolve-dependencies "^28.1.1" - jest-runner "^28.1.1" - jest-runtime "^28.1.1" - jest-snapshot "^28.1.1" - jest-util "^28.1.1" - jest-validate "^28.1.1" - jest-watcher "^28.1.1" + jest-changed-files "^29.0.0" + jest-config "^29.0.1" + jest-haste-map "^29.0.1" + jest-message-util "^29.0.1" + jest-regex-util "^29.0.0" + jest-resolve "^29.0.1" + jest-resolve-dependencies "^29.0.1" + jest-runner "^29.0.1" + jest-runtime "^29.0.1" + jest-snapshot "^29.0.1" + jest-util "^29.0.1" + jest-validate "^29.0.1" + jest-watcher "^29.0.1" micromatch "^4.0.4" - pretty-format "^28.1.1" - rimraf "^3.0.0" + pretty-format "^29.0.1" slash "^3.0.0" strip-ansi "^6.0.0" @@ -2084,6 +2095,16 @@ "@types/node" "*" jest-mock "^28.1.3" +"@jest/environment@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.1.tgz#d236ce9e906744ac58bfc59ae6f7c9882ace7927" + integrity sha512-iLcFfoq2K6DAB+Mc+2VNLzZVmHdwQFeSqvoM/X8SMON6s/+yEi1iuRX3snx/JfwSnvmiMXjSr0lktxNxOcqXYA== + dependencies: + "@jest/fake-timers" "^29.0.1" + "@jest/types" "^29.0.1" + "@types/node" "*" + jest-mock "^29.0.1" + "@jest/expect-utils@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" @@ -2091,6 +2112,13 @@ dependencies: jest-get-type "^28.0.2" +"@jest/expect-utils@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.1.tgz#c1a84ee66caaef537f351dd82f7c63d559cf78d5" + integrity sha512-Tw5kUUOKmXGQDmQ9TSgTraFFS7HMC1HG/B7y0AN2G2UzjdAXz9BzK2rmNpCSDl7g7y0Gf/VLBm//blonvhtOTQ== + dependencies: + jest-get-type "^29.0.0" + "@jest/expect@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.3.tgz#9ac57e1d4491baca550f6bdbd232487177ad6a72" @@ -2099,6 +2127,14 @@ expect "^28.1.3" jest-snapshot "^28.1.3" +"@jest/expect@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.1.tgz#0ffde7f5b4c87f1dd6f8664726bd53f6cd1f7014" + integrity sha512-qKB3q52XDV8VUEiqKKLgLrJx7puQ8sYVqIDlul6n7SIXWS97DOK3KqbR2rDDaMtmenRHqEUl2fI+aFzx0oSemA== + dependencies: + expect "^29.0.1" + jest-snapshot "^29.0.1" + "@jest/fake-timers@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.3.tgz#230255b3ad0a3d4978f1d06f70685baea91c640e" @@ -2111,6 +2147,18 @@ jest-mock "^28.1.3" jest-util "^28.1.3" +"@jest/fake-timers@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.1.tgz#51ba7a82431db479d4b828576c139c4c0dc5e409" + integrity sha512-XZ+kAhLChVQ+KJNa5034p7O1Mz3vtWrelxDcMoxhZkgqmWDaEQAW9qJeutaeCfPvwaEwKYVyKDYfWpcyT8RiMw== + dependencies: + "@jest/types" "^29.0.1" + "@sinonjs/fake-timers" "^9.1.2" + "@types/node" "*" + jest-message-util "^29.0.1" + jest-mock "^29.0.1" + jest-util "^29.0.1" + "@jest/globals@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.3.tgz#a601d78ddc5fdef542728309894895b4a42dc333" @@ -2120,7 +2168,17 @@ "@jest/expect" "^28.1.3" "@jest/types" "^28.1.3" -"@jest/reporters@27.5.1", "@jest/reporters@^28", "@jest/reporters@^28.1.1": +"@jest/globals@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.1.tgz#764135ad31408fb632b3126793ab3aaed933095f" + integrity sha512-BtZWrVrKRKNUt7T1H2S8Mz31PN7ItROCmH+V5pn10hJDUfjOCTIUwb0WtLZzm0f1tJ3Uvx+5lVZrF/VTKqNaFg== + dependencies: + "@jest/environment" "^29.0.1" + "@jest/expect" "^29.0.1" + "@jest/types" "^29.0.1" + jest-mock "^29.0.1" + +"@jest/reporters@27.5.1", "@jest/reporters@^28", "@jest/reporters@^29.0.1": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.3.tgz#9adf6d265edafc5fc4a434cfb31e2df5a67a369a" integrity sha512-JuAy7wkxQZVNU/V6g9xKzCGC5LVXx9FDcABKsSXp5MiKPEE2144a/vXTEDoyzjUpZKfVwp08Wqg5A4WfTMAzjg== @@ -2158,6 +2216,13 @@ dependencies: "@sinclair/typebox" "^0.24.1" +"@jest/schemas@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" + integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== + dependencies: + "@sinclair/typebox" "^0.24.1" + "@jest/source-map@^28.1.2": version "28.1.2" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.1.2.tgz#7fe832b172b497d6663cdff6c13b0a920e139e24" @@ -2167,7 +2232,16 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@27.5.1", "@jest/test-result@^28", "@jest/test-result@^28.1.1", "@jest/test-result@^28.1.3": +"@jest/source-map@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.0.0.tgz#f8d1518298089f8ae624e442bbb6eb870ee7783c" + integrity sha512-nOr+0EM8GiHf34mq2GcJyz/gYFyLQ2INDhAylrZJ9mMWoW21mLBfZa0BUVPPMxVYrLjeiRe2Z7kWXOGnS0TFhQ== + dependencies: + "@jridgewell/trace-mapping" "^0.3.15" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@27.5.1", "@jest/test-result@^28", "@jest/test-result@^28.1.3", "@jest/test-result@^29.0.1": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.3.tgz#5eae945fd9f4b8fcfce74d239e6f725b6bf076c5" integrity sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg== @@ -2187,7 +2261,7 @@ jest-haste-map "^28.1.3" slash "^3.0.0" -"@jest/transform@^28.1.1", "@jest/transform@^28.1.3": +"@jest/transform@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.3.tgz#59d8098e50ab07950e0f2fc0fc7ec462371281b0" integrity sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA== @@ -2208,7 +2282,28 @@ slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.1", "@jest/types@^28.1.3": +"@jest/transform@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.1.tgz#fdaa5d9e135c9bd7addbe65bedd1f15ad028cc7e" + integrity sha512-6UxXtqrPScFdDhoip8ys60dQAIYppQinyR87n9nlasR/ZnFfJohKToqzM29KK4gb9gHRv5oDFChdqZKE0SIhsg== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.0.1" + "@jridgewell/trace-mapping" "^0.3.15" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.0.1" + jest-regex-util "^29.0.0" + jest-util "^29.0.1" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.1" + +"@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== @@ -2220,6 +2315,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.1.tgz#1985650acf137bdb81710ff39a4689ec071dd86a" + integrity sha512-ft01rxzVsbh9qZPJ6EFgAIj3PT9FCRfBF9Xljo2/33VDOUjLZr0ZJ2oKANqh9S/K0/GERCsHDAQlBwj7RxA+9g== + dependencies: + "@jest/schemas" "^29.0.0" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" @@ -2260,6 +2367,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.15": + version "0.3.15" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" + integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -4428,6 +4543,11 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -5329,7 +5449,7 @@ chalk@4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^2.0.0, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -5786,6 +5906,11 @@ console-control-strings@^1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= +console-fail-test@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/console-fail-test/-/console-fail-test-0.1.7.tgz#f21ee5f944fb42c0d176a56c5b4744cb2f8d86c8" + integrity sha512-WZ9unWXJSqDGMt/06wOSPNHwAIAdIJvhgSD2MepJHG5B7b3PD3b8q0NMpaqegGmGFgZUiru+0xEsyvpvg/CM+A== + content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" @@ -5988,6 +6113,17 @@ cross-fetch@^3.0.4, cross-fetch@^3.1.5: dependencies: node-fetch "2.6.7" +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -6638,14 +6774,14 @@ dotenv@~10.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== -downlevel-dts@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.9.0.tgz#23c71e5bdf825a073f80a7ed077553c81aabdf01" - integrity sha512-XDYaZ7yY4yPLlNx3txbYRzUF6WiElAgMJQ/ACIaZnKISwuWw2eAHD7Ecp3u60ntej6i1yaMtjsN02hhA4FakFw== +downlevel-dts@>=0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.10.0.tgz#d2be7b4408a1f9eb3a39e15a361f8ea4f175facc" + integrity sha512-AZ7tnUy4XJArsjv6Bcuivvxx+weMvOGHF6seu7e7PVOqMDHMSlfgMl1kt+F4Y2+5TmDwKWHOdimM1DZKihQs8Q== dependencies: semver "^7.3.2" shelljs "^0.8.3" - typescript "^4.5.5" + typescript next duplexer3@^0.1.4: version "0.1.4" @@ -6925,6 +7061,15 @@ eslint-module-utils@^2.7.3: debug "^3.2.7" find-up "^2.1.0" +eslint-plugin-deprecation@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.3.2.tgz#a8125d28c56158cdfa1a685197e6be8ed86f189e" + integrity sha512-z93wbx9w7H/E3ogPw6AZMkkNJ6m51fTZRNZPNQqxQLmx+KKt7aLkMU9wN67s71i+VVHN4tLOZ3zT3QLbnlC0Mg== + dependencies: + "@typescript-eslint/experimental-utils" "^5.0.0" + tslib "^2.3.1" + tsutils "^3.21.0" + eslint-plugin-eslint-comments@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa" @@ -6992,9 +7137,9 @@ eslint-plugin-react-hooks@^4.5.0: integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== eslint-plugin-react@^7.29.4: - version "7.30.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.30.1.tgz#2be4ab23ce09b5949c6631413ba64b2810fd3e22" - integrity sha512-NbEvI9jtqO46yJA3wcRF9Mo0lF9T/jhdHqhCHXiXtD+Zcb98812wvokjWpU7Q4QH5edo6dmqrukxVvWWXHlsUg== + version "7.31.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.0.tgz#fd3f81c9db5971095b3521ede22781afd37442b0" + integrity sha512-BWriBttYYCnfb4RO9SB91Og8uA9CPcBMl5UlCOCtuYW1UjhN3QypzEcEHky4ZIRZDKjbO2Blh9BjP8E7W/b1SA== dependencies: array-includes "^3.1.5" array.prototype.flatmap "^1.3.0" @@ -7252,6 +7397,17 @@ expect@^28.1.3: jest-message-util "^28.1.3" jest-util "^28.1.3" +expect@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.1.tgz#a2fa64a59cffe4b4007877e730bc82be3d1742bb" + integrity sha512-yQgemsjLU+1S8t2A7pXT3Sn/v5/37LY8J+tocWtKEA0iEYYc6gfKbbJJX2fxHZmd7K9WpdbQqXUpmYkq1aewYg== + dependencies: + "@jest/expect-utils" "^29.0.1" + jest-get-type "^29.0.0" + jest-matcher-utils "^29.0.1" + jest-message-util "^29.0.1" + jest-util "^29.0.1" + express@^4.17.3: version "4.18.1" resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" @@ -7540,6 +7696,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -7633,6 +7796,15 @@ fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^7.0.1, fs-extra@~7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-extra@^9.0.0, fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -7643,15 +7815,6 @@ fs-extra@^9.0.0, fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@~7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -8946,7 +9109,7 @@ is-word-character@^1.0.0: resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.4.tgz#ce0e73216f98599060592f62ff31354ddbeb0230" integrity sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA== -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -9035,13 +9198,13 @@ jake@^10.8.5: filelist "^1.0.1" minimatch "^3.0.4" -jest-changed-files@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.2.tgz#7d7810660a5bd043af9e9cfbe4d58adb05e91531" - integrity sha512-QX9u+5I2s54ZnGoMEjiM2WeBvJR2J7w/8ZUmH2um/WLAuGAYFQcsVXY9+1YL6k0H/AGUdH8pXUAv6erDqEsvIA== +jest-changed-files@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.0.0.tgz#aa238eae42d9372a413dd9a8dadc91ca1806dce0" + integrity sha512-28/iDMDrUpGoCitTURuDqUzWQoWmOmOKOFST1mi2lwh62X4BFf6khgH3uSuo1e49X/UDjuApAj3w0wLOex4VPQ== dependencies: execa "^5.0.0" - throat "^6.0.1" + p-limit "^3.1.0" jest-circus@^28.1.3: version "28.1.3" @@ -9068,25 +9231,25 @@ jest-circus@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.1.tgz#23ddfde8940e1818585ae4a568877b33b0e51cfe" - integrity sha512-+sUfVbJqb1OjBZ0OdBbI6OWfYM1i7bSfzYy6gze1F1w3OKWq8ZTEKkZ8a7ZQPq6G/G1qMh/uKqpdWhgl11NFQQ== +jest-cli@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.1.tgz#6633c2ab97337ac5207910bd6b0aba2ef0900110" + integrity sha512-XozBHtoJCS6mnjCxNESyGm47Y4xSWzNlBJj4tix9nGrG6m068B83lrTWKtjYAenYSfOqyYVpQCkyqUp35IT+qA== dependencies: - "@jest/core" "^28.1.1" - "@jest/test-result" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/core" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/types" "^29.0.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.1.1" - jest-util "^28.1.1" - jest-validate "^28.1.1" + jest-config "^29.0.1" + jest-util "^29.0.1" + jest-validate "^29.0.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@27.5.1, jest-config@^28, jest-config@^28.1.1: +jest-config@27.5.1, jest-config@^28, jest-config@^29.0.1: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.3.tgz#e315e1f73df3cac31447eed8b8740a477392ec60" integrity sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ== @@ -9131,6 +9294,13 @@ jest-docblock@^28.1.1: dependencies: detect-newline "^3.0.0" +jest-docblock@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.0.0.tgz#3151bcc45ed7f5a8af4884dcc049aee699b4ceae" + integrity sha512-s5Kpra/kLzbqu9dEjov30kj1n4tfu3e7Pl8v+f8jOkeWNqM6Ds8jRaJfZow3ducoQUrf2Z4rs2N5S3zXnb83gw== + dependencies: + detect-newline "^3.0.0" + jest-each@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.3.tgz#bdd1516edbe2b1f3569cfdad9acd543040028f81" @@ -9154,12 +9324,24 @@ jest-environment-node@^28.1.3: jest-mock "^28.1.3" jest-util "^28.1.3" -jest-get-type@^28, jest-get-type@^28.0.2: +jest-environment-node@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.1.tgz#b09db2a1b8439aace11a6805719d92498a64987e" + integrity sha512-PcIRBrEBFAPBqkbL53ZpEvTptcAnOW6/lDfqBfACMm3vkVT0N7DcfkH/hqNSbDmSxzGr0FtJI6Ej3TPhveWCMA== + dependencies: + "@jest/environment" "^29.0.1" + "@jest/fake-timers" "^29.0.1" + "@jest/types" "^29.0.1" + "@types/node" "*" + jest-mock "^29.0.1" + jest-util "^29.0.1" + +jest-get-type@^28, jest-get-type@^28.0.2, jest-get-type@^29.0.0: version "28.0.2" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== -jest-haste-map@^28.1.1, jest-haste-map@^28.1.3: +jest-haste-map@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.3.tgz#abd5451129a38d9841049644f34b034308944e2b" integrity sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA== @@ -9178,6 +9360,25 @@ jest-haste-map@^28.1.1, jest-haste-map@^28.1.3: optionalDependencies: fsevents "^2.3.2" +jest-haste-map@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.1.tgz#472212f93ef44309bf97d191f93ddd2e41169615" + integrity sha512-gcKOAydafpGoSBvcj/mGCfhOKO8fRLkAeee1KXGdcJ1Pb9O2nnOl4I8bQSIID2MaZeMHtLLgNboukh/pUGkBtg== + dependencies: + "@jest/types" "^29.0.1" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.0.0" + jest-util "^29.0.1" + jest-worker "^29.0.1" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + jest-leak-detector@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz#a6685d9b074be99e3adee816ce84fd30795e654d" @@ -9186,7 +9387,15 @@ jest-leak-detector@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" -jest-matcher-utils@^28, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.3: +jest-leak-detector@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.1.tgz#1a7cf8475d85e7b2bd53efa5adc5195828a12c33" + integrity sha512-5tISHJphB+sCmKXtVHJGQGltj7ksrLLb9vkuNWwFR86Of1tfzjskvrrrZU1gSzEfWC+qXIn4tuh8noKHYGMIPA== + dependencies: + jest-get-type "^29.0.0" + pretty-format "^29.0.1" + +jest-matcher-utils@^28, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.3, jest-matcher-utils@^29.0.1: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== @@ -9196,7 +9405,7 @@ jest-matcher-utils@^28, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" -jest-message-util@^28.1.1, jest-message-util@^28.1.3: +jest-message-util@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== @@ -9211,6 +9420,21 @@ jest-message-util@^28.1.1, jest-message-util@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.1.tgz#85c4b5b90296c228da158e168eaa5b079f2ab879" + integrity sha512-wRMAQt3HrLpxSubdnzOo68QoTfQ+NLXFzU0Heb18ZUzO2S9GgaXNEdQ4rpd0fI9dq2NXkpCk1IUWSqzYKji64A== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.0.1" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.0.1" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.3.tgz#d4e9b1fc838bea595c77ab73672ebf513ab249da" @@ -9219,6 +9443,14 @@ jest-mock@^28.1.3: "@jest/types" "^28.1.3" "@types/node" "*" +jest-mock@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.1.tgz#12e1b137035365b022ccdb8fd67d476cd4d4bfad" + integrity sha512-i1yTceg2GKJwUNZFjIzrH7Y74fN1SKJWxQX/Vu3LT4TiJerFARH5l+4URNyapZ+DNpchHYrGOP2deVbn3ma8JA== + dependencies: + "@jest/types" "^29.0.1" + "@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" @@ -9229,15 +9461,20 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.1.tgz#3dffaaa56f4b41bc6b61053899d1756401763a27" - integrity sha512-p8Y150xYJth4EXhOuB8FzmS9r8IGLEioiaetgdNGb9VHka4fl0zqWlVe4v7mSkYOuEUg2uB61iE+zySDgrOmgQ== +jest-regex-util@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" + integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== + +jest-resolve-dependencies@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.1.tgz#c41b88380c8ea178ce72a750029b5f3d5f65cb94" + integrity sha512-fUGcYlSc1NzNz+tsHDjjG0rclw6blJcFZsLEsezxm/n54bAm9HFvJxgBuCV1CJQoPtIx6AfR+tXkR9lpWJs2LQ== dependencies: - jest-regex-util "^28.0.2" - jest-snapshot "^28.1.1" + jest-regex-util "^29.0.0" + jest-snapshot "^29.0.1" -jest-resolve@27.5.1, jest-resolve@^28, jest-resolve@^28.1.1, jest-resolve@^28.1.3: +jest-resolve@27.5.1, jest-resolve@^28, jest-resolve@^28.1.3, jest-resolve@^29.0.1: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.3.tgz#cfb36100341ddbb061ec781426b3c31eb51aa0a8" integrity sha512-Z1W3tTjE6QaNI90qo/BJpfnvpxtaFTFw5CDgwpyE/Kz8U/06N1Hjf4ia9quUhCh39qIGWF1ZuxFiBiJQwSEYKQ== @@ -9252,7 +9489,7 @@ jest-resolve@27.5.1, jest-resolve@^28, jest-resolve@^28.1.1, jest-resolve@^28.1. resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.1.1, jest-runner@^28.1.3: +jest-runner@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.3.tgz#5eee25febd730b4713a2cdfd76bdd5557840f9a1" integrity sha512-GkMw4D/0USd62OVO0oEgjn23TM+YJa2U2Wu5zz9xsQB1MxWKDOlrnykPxnMsN0tnJllfLPinHTka61u0QhaxBA== @@ -9279,7 +9516,34 @@ jest-runner@^28.1.1, jest-runner@^28.1.3: p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^28.1.1, jest-runtime@^28.1.3: +jest-runner@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.1.tgz#15bacd13170f3d786168ef8548fdeb96933ea643" + integrity sha512-XeFfPmHtO7HyZyD1uJeO4Oqa8PyTbDHzS1YdGrvsFXk/A5eXinbqA5a42VUEqvsKQgNnKTl5NJD0UtDWg7cQ2A== + dependencies: + "@jest/console" "^29.0.1" + "@jest/environment" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.10.2" + graceful-fs "^4.2.9" + jest-docblock "^29.0.0" + jest-environment-node "^29.0.1" + jest-haste-map "^29.0.1" + jest-leak-detector "^29.0.1" + jest-message-util "^29.0.1" + jest-resolve "^29.0.1" + jest-runtime "^29.0.1" + jest-util "^29.0.1" + jest-watcher "^29.0.1" + jest-worker "^29.0.1" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.3.tgz#a57643458235aa53e8ec7821949e728960d0605f" integrity sha512-NU+881ScBQQLc1JHG5eJGU7Ui3kLKrmwCPPtYsJtBykixrM2OhVQlpMmFWJjMyDfdkGgBMNjXCGB/ebzsgNGQw== @@ -9307,7 +9571,35 @@ jest-runtime@^28.1.1, jest-runtime@^28.1.3: slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@*, jest-snapshot@^27.0.2, jest-snapshot@^28, jest-snapshot@^28.1.0, jest-snapshot@^28.1.1, jest-snapshot@^28.1.3: +jest-runtime@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.1.tgz#cafdc10834c45c50105eecb0ded8677ce741e2af" + integrity sha512-yDgz5OE0Rm44PUAfTqwA6cDFnTYnVcYbRpPECsokSASQ0I5RXpnKPVr2g0CYZWKzbsXqqtmM7TIk7CAutZJ7gQ== + dependencies: + "@jest/environment" "^29.0.1" + "@jest/fake-timers" "^29.0.1" + "@jest/globals" "^29.0.1" + "@jest/source-map" "^29.0.0" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.0.1" + jest-message-util "^29.0.1" + jest-mock "^29.0.1" + jest-regex-util "^29.0.0" + jest-resolve "^29.0.1" + jest-snapshot "^29.0.1" + jest-util "^29.0.1" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@*, jest-snapshot@^27.0.2, jest-snapshot@^28, jest-snapshot@^28.1.0, jest-snapshot@^28.1.3, jest-snapshot@^29.0.1: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.3.tgz#17467b3ab8ddb81e2f605db05583d69388fc0668" integrity sha512-4lzMgtiNlc3DU/8lZfmqxN3AYD6GGLbl+72rdBpXvcV+whX7mDrREzkPdp2RnmfIiWBg1YbuFSkXduF2JcafJg== @@ -9343,7 +9635,7 @@ jest-specific-snapshot@*, jest-specific-snapshot@^5.0.0: dependencies: jest-snapshot "^27.0.2" -jest-util@27.5.1, jest-util@^28, jest-util@^28.1.1, jest-util@^28.1.3: +jest-util@27.5.1, jest-util@^28, jest-util@^28.1.3, jest-util@^29.0.1: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== @@ -9355,7 +9647,7 @@ jest-util@27.5.1, jest-util@^28, jest-util@^28.1.1, jest-util@^28.1.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.1.1, jest-validate@^28.1.3: +jest-validate@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.3.tgz#e322267fd5e7c64cea4629612c357bbda96229df" integrity sha512-SZbOGBWEsaTxBGCOpsRWlXlvNkvTkY0XxRfh7zYmvd8uL5Qzyg0CHAXiXKROflh801quA6+/DsT4ODDthOC/OA== @@ -9367,7 +9659,19 @@ jest-validate@^28.1.1, jest-validate@^28.1.3: leven "^3.1.0" pretty-format "^28.1.3" -jest-watcher@^28.1.1, jest-watcher@^28.1.3: +jest-validate@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.1.tgz#8de8ff9d65507c0477964fd39c5b0a1778e3103d" + integrity sha512-mS4q7F738YXZFWBPqE+NjHU/gEOs7IBIFQ8i9zq5EO691cLrUbLhFq4larf8/lNcmauRO71tn/+DTW2y+MrLow== + dependencies: + "@jest/types" "^29.0.1" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.0.0" + leven "^3.1.0" + pretty-format "^29.0.1" + +jest-watcher@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.3.tgz#c6023a59ba2255e3b4c57179fc94164b3e73abd4" integrity sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g== @@ -9381,6 +9685,20 @@ jest-watcher@^28.1.1, jest-watcher@^28.1.3: jest-util "^28.1.3" string-length "^4.0.1" +jest-watcher@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.1.tgz#63adeb8887a0562ed8f990f413b830ef48a8db94" + integrity sha512-0LBWDL3sZ+vyHRYxjqm2irhfwhUXHonjLSbd0oDeGq44U1e1uUh3icWNXYF8HO/UEnOoa6+OJDncLUXP2Hdg9A== + dependencies: + "@jest/test-result" "^29.0.1" + "@jest/types" "^29.0.1" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.10.2" + jest-util "^29.0.1" + string-length "^4.0.1" + jest-worker@^26.2.1: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" @@ -9408,15 +9726,24 @@ jest-worker@^28.1.3: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^28.1.0: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.1.tgz#3c39a3a09791e16e9ef283597d24ab19a0df701e" - integrity sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA== +jest-worker@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.1.tgz#fb42ff7e05e0573f330ec0cf781fc545dcd11a31" + integrity sha512-+B/2/8WW7goit7qVezG9vnI1QP3dlmuzi2W0zxazAQQ8dcDIA63dDn6j4pjOGBARha/ZevcwYQtNIzCySbS7fQ== dependencies: - "@jest/core" "^28.1.1" - "@jest/types" "^28.1.1" + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.1.tgz#4a1c48d79fada0a47c686a111ed9411fd41cd584" + integrity sha512-liHkwzaW6iwQyhRBFj0A4ZYKcsQ7ers1s62CCT95fPeNzoxT/vQRWwjTT4e7jpSCwrvPP2t1VESuy7GrXcr2ug== + dependencies: + "@jest/core" "^29.0.1" + "@jest/types" "^29.0.1" import-local "^3.0.2" - jest-cli "^28.1.1" + jest-cli "^29.0.1" jju@~1.4.0: version "1.4.0" @@ -9612,6 +9939,13 @@ kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -10497,6 +10831,11 @@ next-tick@1, next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -10929,6 +11268,14 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^8.0.9, open@^8.4.0: version "8.4.0" resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" @@ -11281,6 +11628,25 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" +patch-package@^6.4.7: + version "6.4.7" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.4.7.tgz#2282d53c397909a0d9ef92dae3fdeb558382b148" + integrity sha512-S0vh/ZEafZ17hbhgqdnpunKDfzHQibQizx9g8yEf5dcVk3KOflOfdufRXQX8CSEkyOQwuM/bNz1GwKvFj54kaQ== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^2.4.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^2.0.0" + fs-extra "^7.0.1" + is-ci "^2.0.0" + klaw-sync "^6.0.0" + minimist "^1.2.0" + open "^7.4.2" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -11301,6 +11667,11 @@ path-is-inside@1.0.2: resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -11727,7 +12098,7 @@ pretty-error@^4.0.0: lodash "^4.17.20" renderkid "^3.0.0" -pretty-format@*, pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1, pretty-format@^28.1.3: +pretty-format@*, pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.3, pretty-format@^29.0.1: version "28.1.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.0.tgz#8f5836c6a0dfdb834730577ec18029052191af55" integrity sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q== @@ -12544,6 +12915,13 @@ rimraf@*, rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -12708,7 +13086,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -12839,6 +13217,13 @@ shallowequal@^1.1.0: resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + dependencies: + shebang-regex "^1.0.0" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -12846,6 +13231,11 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== + shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" @@ -12903,6 +13293,11 @@ sitemap@^7.1.1: arg "^5.0.0" sax "^1.2.4" +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -13470,11 +13865,6 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" -throat@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" - integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== - throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -13787,10 +14177,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@4.7.4, "typescript@>=3.3.1 <4.8.0", typescript@^4.5.3, typescript@^4.5.5, typescript@~4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== +typescript@*, typescript@4.8.2, "typescript@>=3.3.1 <4.9.0", typescript@^4.5.3, typescript@next, typescript@~4.7.4: + version "4.8.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" + integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== ua-parser-js@^0.7.30: version "0.7.31" @@ -14390,7 +14780,7 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which@^1.3.1: +which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==