From 30428119abc0ce00b52ae9ded0eec9eb4e0c3828 Mon Sep 17 00:00:00 2001 From: Matt Mayer <152770+matthewmayer@users.noreply.github.com> Date: Mon, 8 May 2023 13:59:30 +0700 Subject: [PATCH 1/9] docs: streamline upgrading guide before release (#2130) --- docs/guide/upgrading.md | 51 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md index 2531f484a0d..8dc353d120c 100644 --- a/docs/guide/upgrading.md +++ b/docs/guide/upgrading.md @@ -2,8 +2,6 @@ This is the migration guide for upgrading from v7 to v8. -Since v8 has not yet been released, this is a work in progress list of any major and breaking changes in v8. - ::: info Not the version you are looking for? - [Upgrading to v7](https://v7.fakerjs.dev/guide/upgrading.html) @@ -100,7 +98,7 @@ For more information refer to our [Localization Guide](localization). ### For missing locale data, Faker will now throw instead of returning `undefined` or `a`-`c` -::: note Note +::: info Note The following section mostly applies to custom-built Faker instances. ::: @@ -186,21 +184,21 @@ try { ### Other deprecated methods removed/replaced -| Old method | New method | -| ------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `faker.unique` | `faker.helpers.unique` (:warning: please have a look at [#1785](https://github.com/faker-js/faker/issues/1785)) | -| `faker.fake` | `faker.helpers.fake` | -| `faker.commerce.color` | `faker.color.human` | -| `faker.company.companyName` | `faker.company.name` | -| `faker.phone.phoneNumber` | `faker.phone.number` | -| `faker.phone.phoneNumberFormat` | No direct replacement, see documentation for `faker.phone.number` | -| `faker.phone.phoneFormats` | No direct replacement, see documentation for `faker.phone.number` | -| `faker.name.findName` | _Removed, replace with `faker.person.fullName`_ | -| `faker.address.cityPrefix` | _Removed_ | -| `faker.address.citySuffix` | _Removed_ | -| `faker.address.streetPrefix` | _Removed_ | -| `faker.address.streetSuffix` | _Removed_ | -| `faker.image.lorempixel` | _Removed, as the LoremPixel service is no longer available_ | +| Old method | New method | +| ------------------------------- | ------------------------------------------------------------------------------------------------------ | +| `faker.unique` | `faker.helpers.unique` (:warning: please check [#1785](https://github.com/faker-js/faker/issues/1785)) | +| `faker.fake` | `faker.helpers.fake` | +| `faker.commerce.color` | `faker.color.human` | +| `faker.company.companyName` | `faker.company.name` | +| `faker.phone.phoneNumber` | `faker.phone.number` | +| `faker.phone.phoneNumberFormat` | No direct replacement, see documentation for `faker.phone.number` | +| `faker.phone.phoneFormats` | No direct replacement, see documentation for `faker.phone.number` | +| `faker.name.findName` | _Removed, replace with `faker.person.fullName`_ | +| `faker.address.cityPrefix` | _Removed_ | +| `faker.address.citySuffix` | _Removed_ | +| `faker.address.streetPrefix` | _Removed_ | +| `faker.address.streetSuffix` | _Removed_ | +| `faker.image.lorempixel` | _Removed, as the LoremPixel service is no longer available_ | ### Definitions removed @@ -214,6 +212,13 @@ Some data definitions, which were only available via the `faker.helpers.fake` me ## Deprecations and other changes +This is not an exhaustive list of all deprecations in v8.0.0. Many methods and parameters have been renamed in this release. You can: + +- use the warnings which are shown at runtime to guide you to the new names +- use a [suitable plugin](https://www.npmjs.com/package/eslint-plugin-deprecation) to find usages of deprecated code +- Review the full list of deprecations [here](https://github.com/faker-js/faker/issues?q=label%3Adeprecation+is%3Amerged+milestone%3A%22v8.0+-+Module+Re-Shuffling%22) and [here](https://github.com/faker-js/faker/issues?q=label%3Adeprecation+is%3Amerged+milestone%3A%22v8+-+None+milestone+specific+tasks%22) +- Ignore the deprecations for now: the old names will continue to work for v8.x.x, however you will need to make changes before upgrading to v9.x.x. + ### `faker.name` changed to `faker.person` The whole `faker.name` module is now located at `faker.person`, as it contains more information than just names. @@ -270,14 +275,6 @@ The `faker.address.*` methods will continue to work as an alias in v8 and v9, bu | `faker.address.streetPrefix` | _Removed_ | | `faker.address.streetSuffix` | _Removed_ | -### `faker.finance.account` changed to `faker.finance.accountNumber` - -The `faker.finance.account` method has been renamed to `faker.finance.accountNumber` to better reflect the data it returns and not to get confused with a user "Account". - -### `faker.finance.mask` changed to `faker.finance.maskedNumber` - -The `faker.finance.mask` method has been renamed to `faker.finance.maskedNumber` to better reflect its purpose. - ### Number methods of `faker.datatype` moved to new `faker.number` module The number-related methods previously found in `faker.datatype` have been moved to a new `faker.number` module. @@ -324,7 +321,7 @@ The functions `faker.system.mimeType`, `faker.system.fileType` and `faker.system ### `faker.helpers.unique` is planned to be outsourced The `faker.helpers.unique` method is planned to be outsourced to a separate package. -Please have a look at issue [#1785](https://github.com/faker-js/faker/issues/1785) for more details. +Please check issue [#1785](https://github.com/faker-js/faker/issues/1785) for more details. ### Locales renamed From 6e8971e271ea4080457f7b9310d0cfd24d1f4dbf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 07:14:15 +0000 Subject: [PATCH 2/9] chore(deps): update pnpm to v8.4.0 (#2135) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 71ab176c8b5..02a414c1771 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "vitest": "~0.30.1", "vue": "~3.2.47" }, - "packageManager": "pnpm@8.3.1", + "packageManager": "pnpm@8.4.0", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0", "npm": ">=6.14.13" From 982b9b74951e2bb78f1254a27592dbb4973e7d49 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 09:29:40 +0200 Subject: [PATCH 3/9] chore(deps): update devdependencies (#2132) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 12 ++-- pnpm-lock.yaml | 182 ++++++++++++++++++++++++------------------------- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/package.json b/package.json index 02a414c1771..f831c2cd192 100644 --- a/package.json +++ b/package.json @@ -96,27 +96,27 @@ "@algolia/client-search": "~4.17.0", "@types/glob": "~8.1.0", "@types/markdown-it": "~12.2.3", - "@types/node": "~18.16.3", + "@types/node": "~18.16.5", "@types/prettier": "~2.7.2", "@types/react": "~18.2.0", "@types/sanitize-html": "~2.9.0", "@types/semver": "~7.3.13", - "@types/validator": "~13.7.15", + "@types/validator": "~13.7.16", "@typescript-eslint/eslint-plugin": "~5.59.1", "@typescript-eslint/parser": "~5.59.1", "@vitest/coverage-c8": "~0.30.1", "@vitest/ui": "~0.30.1", - "@vueuse/core": "~10.1.0", + "@vueuse/core": "~10.1.2", "c8": "~7.13.0", "conventional-changelog-cli": "~2.2.2", "cypress": "~12.11.0", "esbuild": "~0.17.18", - "eslint": "~8.39.0", + "eslint": "~8.40.0", "eslint-config-prettier": "~8.8.0", "eslint-define-config": "~1.20.0", "eslint-gitignore": "~0.1.0", "eslint-plugin-deprecation": "~1.4.1", - "eslint-plugin-jsdoc": "~43.1.1", + "eslint-plugin-jsdoc": "~43.2.0", "eslint-plugin-prettier": "~4.2.1", "glob": "~10.2.2", "npm-run-all": "~4.1.5", @@ -133,7 +133,7 @@ "typedoc": "~0.24.6", "typescript": "~4.9.5", "validator": "~13.9.0", - "vite": "~4.3.3", + "vite": "~4.3.5", "vitepress": "1.0.0-alpha.75", "vitest": "~0.30.1", "vue": "~3.2.47" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 598675fcfae..2cc464cad6d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ devDependencies: specifier: ~12.2.3 version: 12.2.3 '@types/node': - specifier: ~18.16.3 - version: 18.16.3 + specifier: ~18.16.5 + version: 18.16.5 '@types/prettier': specifier: ~2.7.2 version: 2.7.2 @@ -29,14 +29,14 @@ devDependencies: specifier: ~7.3.13 version: 7.3.13 '@types/validator': - specifier: ~13.7.15 - version: 13.7.15 + specifier: ~13.7.16 + version: 13.7.16 '@typescript-eslint/eslint-plugin': specifier: ~5.59.1 - version: 5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.39.0)(typescript@4.9.5) + version: 5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.40.0)(typescript@4.9.5) '@typescript-eslint/parser': specifier: ~5.59.1 - version: 5.59.1(eslint@8.39.0)(typescript@4.9.5) + version: 5.59.1(eslint@8.40.0)(typescript@4.9.5) '@vitest/coverage-c8': specifier: ~0.30.1 version: 0.30.1(vitest@0.30.1) @@ -44,8 +44,8 @@ devDependencies: specifier: ~0.30.1 version: 0.30.1 '@vueuse/core': - specifier: ~10.1.0 - version: 10.1.0(vue@3.2.47) + specifier: ~10.1.2 + version: 10.1.2(vue@3.2.47) c8: specifier: ~7.13.0 version: 7.13.0 @@ -59,26 +59,26 @@ devDependencies: specifier: ~0.17.18 version: 0.17.18 eslint: - specifier: ~8.39.0 - version: 8.39.0 + specifier: ~8.40.0 + version: 8.40.0 eslint-config-prettier: specifier: ~8.8.0 - version: 8.8.0(eslint@8.39.0) + version: 8.8.0(eslint@8.40.0) eslint-define-config: specifier: ~1.20.0 version: 1.20.0 eslint-gitignore: specifier: ~0.1.0 - version: 0.1.0(eslint@8.39.0) + version: 0.1.0(eslint@8.40.0) eslint-plugin-deprecation: specifier: ~1.4.1 - version: 1.4.1(eslint@8.39.0)(typescript@4.9.5) + version: 1.4.1(eslint@8.40.0)(typescript@4.9.5) eslint-plugin-jsdoc: - specifier: ~43.1.1 - version: 43.1.1(eslint@8.39.0) + specifier: ~43.2.0 + version: 43.2.0(eslint@8.40.0) eslint-plugin-prettier: specifier: ~4.2.1 - version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.39.0)(prettier@2.8.8) + version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.40.0)(prettier@2.8.8) glob: specifier: ~10.2.2 version: 10.2.2 @@ -125,11 +125,11 @@ devDependencies: specifier: ~13.9.0 version: 13.9.0 vite: - specifier: ~4.3.3 - version: 4.3.3(@types/node@18.16.3) + specifier: ~4.3.5 + version: 4.3.5(@types/node@18.16.5) vitepress: specifier: 1.0.0-alpha.75 - version: 1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.3)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0) + version: 1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0) vitest: specifier: ~0.30.1 version: 0.30.1(@vitest/ui@0.30.1) @@ -395,9 +395,9 @@ packages: - '@algolia/client-search' dev: true - /@es-joy/jsdoccomment@0.37.1: - resolution: {integrity: sha512-5vxWJ1gEkEF0yRd0O+uK6dHJf7adrxwQSX8PuRiPfFSAbNLnY0ZJfXaZucoz14Jj2N11xn2DnlEPwWRpYpvRjg==} - engines: {node: ^14 || ^16 || ^17 || ^18 || ^19 || ^20} + /@es-joy/jsdoccomment@0.38.0: + resolution: {integrity: sha512-TFac4Bnv0ZYNkEeDnOWHQhaS1elWlvOCQxH06iHeu5iffs+hCaLVIZJwF+FqksQi68R4i66Pu+4DfFGvble+Uw==} + engines: {node: '>=16'} dependencies: comment-parser: 1.3.1 esquery: 1.5.0 @@ -623,13 +623,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.39.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.40.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.39.0 + eslint: 8.40.0 eslint-visitor-keys: 3.4.1 dev: true @@ -655,8 +655,8 @@ packages: - supports-color dev: true - /@eslint/js@8.39.0: - resolution: {integrity: sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==} + /@eslint/js@8.40.0: + resolution: {integrity: sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -856,7 +856,7 @@ packages: resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 18.16.3 + '@types/node': 18.16.5 dev: true /@types/istanbul-lib-coverage@2.0.4: @@ -894,8 +894,8 @@ packages: resolution: {integrity: sha512-Nd+FPp60jEaJpm4LAxuLT3wIhB4k0Jdj9DAP4ydqGyMg8DhE+7oM1we+QkwOkpMySTjcqcNfPOWY5kBuAOhkeg==} dev: true - /@types/node@18.16.3: - resolution: {integrity: sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q==} + /@types/node@18.16.5: + resolution: {integrity: sha512-seOA34WMo9KB+UA78qaJoCO20RJzZGVXQ5Sh6FWu0g/hfT44nKXnej3/tCQl7FL97idFpBhisLYCTB50S0EirA==} dev: true /@types/normalize-package-data@2.4.1: @@ -940,23 +940,23 @@ packages: resolution: {integrity: sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==} dev: true - /@types/validator@13.7.15: - resolution: {integrity: sha512-yeinDVQunb03AEP8luErFcyf/7Lf7AzKCD0NXfgVoGCCQDNpZET8Jgq74oBgqKld3hafLbfzt/3inUdQvaFeXQ==} + /@types/validator@13.7.16: + resolution: {integrity: sha512-VyKmLktUHYLbrSbsRi241MSUlGYomQgK/tfCNpej3Gt5qDOM10AZ3nU2aR2s5JritClXuOBu4K7MkywVW/Y6Ow==} dev: true - /@types/web-bluetooth@0.0.16: - resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + /@types/web-bluetooth@0.0.17: + resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} dev: true /@types/yauzl@2.10.0: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 18.16.3 + '@types/node': 18.16.5 dev: true optional: true - /@typescript-eslint/eslint-plugin@5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.39.0)(typescript@4.9.5): + /@typescript-eslint/eslint-plugin@5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-AVi0uazY5quFB9hlp2Xv+ogpfpk77xzsgsIEWyVS7uK/c7MZ5tw7ZPbapa0SbfkqE0fsAMkz5UwtgMLVk2BQAg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -968,12 +968,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.1(eslint@8.39.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.59.1(eslint@8.40.0)(typescript@4.9.5) '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/type-utils': 5.59.1(eslint@8.39.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.59.1(eslint@8.39.0)(typescript@4.9.5) + '@typescript-eslint/type-utils': 5.59.1(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.59.1(eslint@8.40.0)(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 + eslint: 8.40.0 grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -984,7 +984,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@5.59.1(eslint@8.39.0)(typescript@4.9.5): + /@typescript-eslint/parser@5.59.1(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-nzjFAN8WEu6yPRDizIFyzAfgK7nybPodMNFGNH0M9tei2gYnYszRDqVA0xlnRjkl7Hkx2vYrEdb6fP2a21cG1g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -998,7 +998,7 @@ packages: '@typescript-eslint/types': 5.59.1 '@typescript-eslint/typescript-estree': 5.59.1(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 + eslint: 8.40.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -1020,7 +1020,7 @@ packages: '@typescript-eslint/visitor-keys': 5.59.2 dev: true - /@typescript-eslint/type-utils@5.59.1(eslint@8.39.0)(typescript@4.9.5): + /@typescript-eslint/type-utils@5.59.1(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-ZMWQ+Oh82jWqWzvM3xU+9y5U7MEMVv6GLioM3R5NJk6uvP47kZ7YvlgSHJ7ERD6bOY7Q4uxWm25c76HKEwIjZw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1031,9 +1031,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.59.1(typescript@4.9.5) - '@typescript-eslint/utils': 5.59.1(eslint@8.39.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.59.1(eslint@8.40.0)(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 + eslint: 8.40.0 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: @@ -1092,19 +1092,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@5.59.1(eslint@8.39.0)(typescript@4.9.5): + /@typescript-eslint/utils@5.59.1(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-MkTe7FE+K1/GxZkP5gRj3rCztg45bEhsd8HYjczBuYm+qFHP5vtZmjx3B0yUCDotceQ4sHgTyz60Ycl225njmA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.39.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 '@typescript-eslint/scope-manager': 5.59.1 '@typescript-eslint/types': 5.59.1 '@typescript-eslint/typescript-estree': 5.59.1(typescript@4.9.5) - eslint: 8.39.0 + eslint: 8.40.0 eslint-scope: 5.1.1 semver: 7.5.0 transitivePeerDependencies: @@ -1112,19 +1112,19 @@ packages: - typescript dev: true - /@typescript-eslint/utils@5.59.2(eslint@8.39.0)(typescript@4.9.5): + /@typescript-eslint/utils@5.59.2(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.39.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 '@typescript-eslint/scope-manager': 5.59.2 '@typescript-eslint/types': 5.59.2 '@typescript-eslint/typescript-estree': 5.59.2(typescript@4.9.5) - eslint: 8.39.0 + eslint: 8.40.0 eslint-scope: 5.1.1 semver: 7.5.0 transitivePeerDependencies: @@ -1148,14 +1148,14 @@ packages: eslint-visitor-keys: 3.4.1 dev: true - /@vitejs/plugin-vue@4.2.1(vite@4.3.3)(vue@3.2.47): + /@vitejs/plugin-vue@4.2.1(vite@4.3.5)(vue@3.2.47): resolution: {integrity: sha512-ZTZjzo7bmxTRTkb8GSTwkPOYDIP7pwuyV+RV53c9PYUouwcbkIZIvWvNWlX2b1dYZqtOv7D6iUAnJLVNGcLrSw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.3.3(@types/node@18.16.3) + vite: 4.3.5(@types/node@18.16.5) vue: 3.2.47 dev: true @@ -1308,24 +1308,24 @@ packages: resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==} dev: true - /@vueuse/core@10.1.0(vue@3.2.47): - resolution: {integrity: sha512-3Znoa5m5RO+z4/C9w6DRaKTR3wCVJvD5rav8HTDGsr+7rOZRHtcgFJ8NcCs0ZvIpmev2kExTa311ns5j2RbzDQ==} + /@vueuse/core@10.1.2(vue@3.2.47): + resolution: {integrity: sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==} dependencies: - '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 10.1.0 - '@vueuse/shared': 10.1.0(vue@3.2.47) + '@types/web-bluetooth': 0.0.17 + '@vueuse/metadata': 10.1.2 + '@vueuse/shared': 10.1.2(vue@3.2.47) vue-demi: 0.14.0(vue@3.2.47) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata@10.1.0: - resolution: {integrity: sha512-cM28HjDEw5FIrPE9rgSPFZvQ0ZYnOLAOr8hl1XM6tFl80U3WAR5ROdnAqiYybniwP5gt9MKKAJAqd/ab2aHkqg==} + /@vueuse/metadata@10.1.2: + resolution: {integrity: sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==} dev: true - /@vueuse/shared@10.1.0(vue@3.2.47): - resolution: {integrity: sha512-2X52ogu12i9DkKOQ01yeb/BKg9UO87RNnpm5sXkQvyORlbq8ONS5l39MYkjkeVWWjdT0teJru7a2S41dmHmqjQ==} + /@vueuse/shared@10.1.2(vue@3.2.47): + resolution: {integrity: sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==} dependencies: vue-demi: 0.14.0(vue@3.2.47) transitivePeerDependencies: @@ -2414,13 +2414,13 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@8.8.0(eslint@8.39.0): + /eslint-config-prettier@8.8.0(eslint@8.40.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.39.0 + eslint: 8.40.0 dev: true /eslint-define-config@1.20.0: @@ -2428,7 +2428,7 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13', pnpm: '>= 7.0.0'} dev: true - /eslint-gitignore@0.1.0(eslint@8.39.0): + /eslint-gitignore@0.1.0(eslint@8.40.0): resolution: {integrity: sha512-VFvY5Wyjuz5xXDC/NeONHzsh4YQNok2Gzg4SftAAuhkbrdHv5CChjfiFyLKhRlgOdCJr5kBquaLXHtuDBTW2/Q==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -2436,20 +2436,20 @@ packages: dependencies: array.prototype.flatmap: 1.3.1 debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 + eslint: 8.40.0 fast-glob: 3.2.12 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-deprecation@1.4.1(eslint@8.39.0)(typescript@4.9.5): + /eslint-plugin-deprecation@1.4.1(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-4vxTghWzxsBukPJVQupi6xlTuDc8Pyi1QlRCrFiLgwLPMJQW3cJCNaehJUKQqQFvuue5m4W27e179Y3Qjzeghg==} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 typescript: ^3.7.5 || ^4.0.0 || ^5.0.0 dependencies: - '@typescript-eslint/utils': 5.59.2(eslint@8.39.0)(typescript@4.9.5) - eslint: 8.39.0 + '@typescript-eslint/utils': 5.59.2(eslint@8.40.0)(typescript@4.9.5) + eslint: 8.40.0 tslib: 2.5.0 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 @@ -2457,18 +2457,18 @@ packages: - supports-color dev: true - /eslint-plugin-jsdoc@43.1.1(eslint@8.39.0): - resolution: {integrity: sha512-J2kjjsJ5vBXSyNzqJhceeSGTAgVgZHcPSJKo3vD4tNjUdfky98rR2VfZUDsS1GKL6isyVa8GWvr+Az7Vyg2HXA==} + /eslint-plugin-jsdoc@43.2.0(eslint@8.40.0): + resolution: {integrity: sha512-Hst7XUfqh28UmPD52oTXmjaRN3d0KrmOZdgtp4h9/VHUJD3Evoo82ZGXi1TtRDWgWhvqDIRI63O49H0eH7NrZQ==} engines: {node: '>=16'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@es-joy/jsdoccomment': 0.37.1 + '@es-joy/jsdoccomment': 0.38.0 are-docs-informative: 0.0.2 comment-parser: 1.3.1 debug: 4.3.4(supports-color@8.1.1) escape-string-regexp: 4.0.0 - eslint: 8.39.0 + eslint: 8.40.0 esquery: 1.5.0 semver: 7.5.0 spdx-expression-parse: 3.0.1 @@ -2476,7 +2476,7 @@ packages: - supports-color dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.39.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.40.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -2487,8 +2487,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.39.0 - eslint-config-prettier: 8.8.0(eslint@8.39.0) + eslint: 8.40.0 + eslint-config-prettier: 8.8.0(eslint@8.40.0) prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: true @@ -2514,15 +2514,15 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.39.0: - resolution: {integrity: sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==} + /eslint@8.40.0: + resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.39.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) '@eslint-community/regexpp': 4.5.1 '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.39.0 + '@eslint/js': 8.40.0 '@humanwhocodes/config-array': 0.11.8 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -5088,7 +5088,7 @@ packages: extsprintf: 1.3.0 dev: true - /vite-node@0.30.1(@types/node@18.16.3): + /vite-node@0.30.1(@types/node@18.16.5): resolution: {integrity: sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg==} engines: {node: '>=v14.18.0'} hasBin: true @@ -5098,7 +5098,7 @@ packages: mlly: 1.2.0 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.3.3(@types/node@18.16.3) + vite: 4.3.5(@types/node@18.16.5) transitivePeerDependencies: - '@types/node' - less @@ -5109,8 +5109,8 @@ packages: - terser dev: true - /vite@4.3.3(@types/node@18.16.3): - resolution: {integrity: sha512-MwFlLBO4udZXd+VBcezo3u8mC77YQk+ik+fbc0GZWGgzfbPP+8Kf0fldhARqvSYmtIWoAJ5BXPClUbMTlqFxrA==} + /vite@4.3.5(@types/node@18.16.5): + resolution: {integrity: sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -5134,7 +5134,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.16.3 + '@types/node': 18.16.5 esbuild: 0.17.18 postcss: 8.4.23 rollup: 3.21.5 @@ -5142,20 +5142,20 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.3)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0): + /vitepress@1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-twpPZ/6UnDR8X0Nmj767KwKhXlTQQM9V/J1i2BP9ryO29/w4hpxBfEum6nvfpNhJ4H3h+cIhwzAK/e9crZ6HEQ==} hasBin: true dependencies: '@docsearch/css': 3.3.4 '@docsearch/js': 3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0) - '@vitejs/plugin-vue': 4.2.1(vite@4.3.3)(vue@3.2.47) + '@vitejs/plugin-vue': 4.2.1(vite@4.3.5)(vue@3.2.47) '@vue/devtools-api': 6.5.0 - '@vueuse/core': 10.1.0(vue@3.2.47) + '@vueuse/core': 10.1.2(vue@3.2.47) body-scroll-lock: 4.0.0-beta.0 mark.js: 8.11.1 minisearch: 6.0.1 shiki: 0.14.2 - vite: 4.3.3(@types/node@18.16.3) + vite: 4.3.5(@types/node@18.16.5) vue: 3.2.47 transitivePeerDependencies: - '@algolia/client-search' @@ -5204,7 +5204,7 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 18.16.3 + '@types/node': 18.16.5 '@vitest/expect': 0.30.1 '@vitest/runner': 0.30.1 '@vitest/snapshot': 0.30.1 @@ -5226,8 +5226,8 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.4.0 - vite: 4.3.3(@types/node@18.16.3) - vite-node: 0.30.1(@types/node@18.16.3) + vite: 4.3.5(@types/node@18.16.5) + vite-node: 0.30.1(@types/node@18.16.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From a0887a516984b975827dece64de8ae18da37a59e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 07:45:45 +0000 Subject: [PATCH 4/9] chore(deps): update typescript-eslint to ~5.59.2 (#2134) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- pnpm-lock.yaml | 100 ++++++++++--------------------------------------- 2 files changed, 21 insertions(+), 83 deletions(-) diff --git a/package.json b/package.json index f831c2cd192..6e2f97912b0 100644 --- a/package.json +++ b/package.json @@ -102,8 +102,8 @@ "@types/sanitize-html": "~2.9.0", "@types/semver": "~7.3.13", "@types/validator": "~13.7.16", - "@typescript-eslint/eslint-plugin": "~5.59.1", - "@typescript-eslint/parser": "~5.59.1", + "@typescript-eslint/eslint-plugin": "~5.59.2", + "@typescript-eslint/parser": "~5.59.2", "@vitest/coverage-c8": "~0.30.1", "@vitest/ui": "~0.30.1", "@vueuse/core": "~10.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2cc464cad6d..7ae02093937 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,11 +32,11 @@ devDependencies: specifier: ~13.7.16 version: 13.7.16 '@typescript-eslint/eslint-plugin': - specifier: ~5.59.1 - version: 5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.40.0)(typescript@4.9.5) + specifier: ~5.59.2 + version: 5.59.2(@typescript-eslint/parser@5.59.2)(eslint@8.40.0)(typescript@4.9.5) '@typescript-eslint/parser': - specifier: ~5.59.1 - version: 5.59.1(eslint@8.40.0)(typescript@4.9.5) + specifier: ~5.59.2 + version: 5.59.2(eslint@8.40.0)(typescript@4.9.5) '@vitest/coverage-c8': specifier: ~0.30.1 version: 0.30.1(vitest@0.30.1) @@ -956,8 +956,8 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin@5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-AVi0uazY5quFB9hlp2Xv+ogpfpk77xzsgsIEWyVS7uK/c7MZ5tw7ZPbapa0SbfkqE0fsAMkz5UwtgMLVk2BQAg==} + /@typescript-eslint/eslint-plugin@5.59.2(@typescript-eslint/parser@5.59.2)(eslint@8.40.0)(typescript@4.9.5): + resolution: {integrity: sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -968,10 +968,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.1(eslint@8.40.0)(typescript@4.9.5) - '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/type-utils': 5.59.1(eslint@8.40.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.59.1(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.59.2(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.59.2 + '@typescript-eslint/type-utils': 5.59.2(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.59.2(eslint@8.40.0)(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) eslint: 8.40.0 grapheme-splitter: 1.0.4 @@ -984,8 +984,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@5.59.1(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-nzjFAN8WEu6yPRDizIFyzAfgK7nybPodMNFGNH0M9tei2gYnYszRDqVA0xlnRjkl7Hkx2vYrEdb6fP2a21cG1g==} + /@typescript-eslint/parser@5.59.2(eslint@8.40.0)(typescript@4.9.5): + resolution: {integrity: sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -994,9 +994,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/typescript-estree': 5.59.1(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.59.2 + '@typescript-eslint/types': 5.59.2 + '@typescript-eslint/typescript-estree': 5.59.2(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) eslint: 8.40.0 typescript: 4.9.5 @@ -1004,14 +1004,6 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@5.59.1: - resolution: {integrity: sha512-mau0waO5frJctPuAzcxiNWqJR5Z8V0190FTSqRw1Q4Euop6+zTwHAf8YIXNwDOT29tyUDrQ65jSg9aTU/H0omA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/visitor-keys': 5.59.1 - dev: true - /@typescript-eslint/scope-manager@5.59.2: resolution: {integrity: sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1020,8 +1012,8 @@ packages: '@typescript-eslint/visitor-keys': 5.59.2 dev: true - /@typescript-eslint/type-utils@5.59.1(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-ZMWQ+Oh82jWqWzvM3xU+9y5U7MEMVv6GLioM3R5NJk6uvP47kZ7YvlgSHJ7ERD6bOY7Q4uxWm25c76HKEwIjZw==} + /@typescript-eslint/type-utils@5.59.2(eslint@8.40.0)(typescript@4.9.5): + resolution: {integrity: sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -1030,8 +1022,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.1(typescript@4.9.5) - '@typescript-eslint/utils': 5.59.1(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 5.59.2(typescript@4.9.5) + '@typescript-eslint/utils': 5.59.2(eslint@8.40.0)(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) eslint: 8.40.0 tsutils: 3.21.0(typescript@4.9.5) @@ -1040,37 +1032,11 @@ packages: - supports-color dev: true - /@typescript-eslint/types@5.59.1: - resolution: {integrity: sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - /@typescript-eslint/types@5.59.2: resolution: {integrity: sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.59.1(typescript@4.9.5): - resolution: {integrity: sha512-lYLBBOCsFltFy7XVqzX0Ju+Lh3WPIAWxYpmH/Q7ZoqzbscLiCW00LeYCdsUnnfnj29/s1WovXKh2gwCoinHNGA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/visitor-keys': 5.59.1 - debug: 4.3.4(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/typescript-estree@5.59.2(typescript@4.9.5): resolution: {integrity: sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1092,26 +1058,6 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@5.59.1(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-MkTe7FE+K1/GxZkP5gRj3rCztg45bEhsd8HYjczBuYm+qFHP5vtZmjx3B0yUCDotceQ4sHgTyz60Ycl225njmA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@types/json-schema': 7.0.11 - '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/typescript-estree': 5.59.1(typescript@4.9.5) - eslint: 8.40.0 - eslint-scope: 5.1.1 - semver: 7.5.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /@typescript-eslint/utils@5.59.2(eslint@8.40.0)(typescript@4.9.5): resolution: {integrity: sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1132,14 +1078,6 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@5.59.1: - resolution: {integrity: sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.1 - eslint-visitor-keys: 3.4.1 - dev: true - /@typescript-eslint/visitor-keys@5.59.2: resolution: {integrity: sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} From 42d3e283eb7c280504ebf22cf59ba09a6e037bf5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 08:06:45 +0000 Subject: [PATCH 5/9] chore(deps): update dependency eslint-plugin-jsdoc to v44 (#2137) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6e2f97912b0..07e6ed0f84c 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "eslint-define-config": "~1.20.0", "eslint-gitignore": "~0.1.0", "eslint-plugin-deprecation": "~1.4.1", - "eslint-plugin-jsdoc": "~43.2.0", + "eslint-plugin-jsdoc": "~44.0.0", "eslint-plugin-prettier": "~4.2.1", "glob": "~10.2.2", "npm-run-all": "~4.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ae02093937..39a5a4ab02c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,8 +74,8 @@ devDependencies: specifier: ~1.4.1 version: 1.4.1(eslint@8.40.0)(typescript@4.9.5) eslint-plugin-jsdoc: - specifier: ~43.2.0 - version: 43.2.0(eslint@8.40.0) + specifier: ~44.0.0 + version: 44.0.0(eslint@8.40.0) eslint-plugin-prettier: specifier: ~4.2.1 version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.40.0)(prettier@2.8.8) @@ -2395,8 +2395,8 @@ packages: - supports-color dev: true - /eslint-plugin-jsdoc@43.2.0(eslint@8.40.0): - resolution: {integrity: sha512-Hst7XUfqh28UmPD52oTXmjaRN3d0KrmOZdgtp4h9/VHUJD3Evoo82ZGXi1TtRDWgWhvqDIRI63O49H0eH7NrZQ==} + /eslint-plugin-jsdoc@44.0.0(eslint@8.40.0): + resolution: {integrity: sha512-UZ07io4GFaD4awLJPuo0b1Q96ll5kJjwo74SYo9pprUww4BVeVn7EVslU5G6FcfGIfV+kgDLfYQQFODZgicWfQ==} engines: {node: '>=16'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 From 23eb0f5b3962f334dbbf8fda52b6639ff7b66a96 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 08:14:48 +0000 Subject: [PATCH 6/9] chore(deps): update doc-dependencies (#2133) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- pnpm-lock.yaml | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 07e6ed0f84c..91ff9bc2d97 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "@types/markdown-it": "~12.2.3", "@types/node": "~18.16.5", "@types/prettier": "~2.7.2", - "@types/react": "~18.2.0", + "@types/react": "~18.2.6", "@types/sanitize-html": "~2.9.0", "@types/semver": "~7.3.13", "@types/validator": "~13.7.16", @@ -130,7 +130,7 @@ "semver": "~7.5.0", "standard-version": "~9.5.0", "tsx": "~3.12.7", - "typedoc": "~0.24.6", + "typedoc": "~0.24.7", "typescript": "~4.9.5", "validator": "~13.9.0", "vite": "~4.3.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39a5a4ab02c..e7f2dc05662 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,8 +20,8 @@ devDependencies: specifier: ~2.7.2 version: 2.7.2 '@types/react': - specifier: ~18.2.0 - version: 18.2.0 + specifier: ~18.2.6 + version: 18.2.6 '@types/sanitize-html': specifier: ~2.9.0 version: 2.9.0 @@ -116,8 +116,8 @@ devDependencies: specifier: ~3.12.7 version: 3.12.7 typedoc: - specifier: ~0.24.6 - version: 0.24.6(typescript@4.9.5) + specifier: ~0.24.7 + version: 0.24.7(typescript@4.9.5) typescript: specifier: ~4.9.5 version: 4.9.5 @@ -129,7 +129,7 @@ devDependencies: version: 4.3.5(@types/node@18.16.5) vitepress: specifier: 1.0.0-alpha.75 - version: 1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0) + version: 1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) vitest: specifier: ~0.30.1 version: 0.30.1(@vitest/ui@0.30.1) @@ -358,10 +358,10 @@ packages: resolution: {integrity: sha512-vDwCDoVXDgopw/hvr0zEADew2wWaGP8Qq0Bxhgii1Ewz2t4fQeyJwIRN/mWADeLFYPVkpz8TpEbxya/i6Tm0WA==} dev: true - /@docsearch/js@3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0): + /@docsearch/js@3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Xd2saBziXJ1UuVpcDz94zAFEFAM6ap993agh0za2e3LDZLhaW993b1f9gyUL4e1CZLsR076tztG2un2gVncvpA==} dependencies: - '@docsearch/react': 3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0) + '@docsearch/react': 3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) preact: 10.13.2 transitivePeerDependencies: - '@algolia/client-search' @@ -370,7 +370,7 @@ packages: - react-dom dev: true - /@docsearch/react@3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0): + /@docsearch/react@3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-aeOf1WC5zMzBEi2SI6WWznOmIo9rnpN4p7a3zHXxowVciqlI4HsZGtOR9nFOufLeolv7HibwLlaM0oyUqJxasw==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -387,7 +387,7 @@ packages: '@algolia/autocomplete-core': 1.8.2 '@algolia/autocomplete-preset-algolia': 1.8.2(@algolia/client-search@4.17.0)(algoliasearch@4.17.0) '@docsearch/css': 3.3.4 - '@types/react': 18.2.0 + '@types/react': 18.2.6 algoliasearch: 4.17.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -910,8 +910,8 @@ packages: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} dev: true - /@types/react@18.2.0: - resolution: {integrity: sha512-0FLj93y5USLHdnhIhABk83rm8XEGA7kH3cr+YUlvxoUGp1xNt/DINUMvqPxLyOQMzLmZe8i4RTHbvb8MC7NmrA==} + /@types/react@18.2.6: + resolution: {integrity: sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.3 @@ -4920,8 +4920,8 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typedoc@0.24.6(typescript@4.9.5): - resolution: {integrity: sha512-c3y3h45xJv3qYwKDAwU6Cl+26CjT0ZvblHzfHJ+SjQDM4p1mZxtgHky4lhmG0+nNarRht8kADfZlbspJWdZarQ==} + /typedoc@0.24.7(typescript@4.9.5): + resolution: {integrity: sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==} engines: {node: '>= 14.14'} hasBin: true peerDependencies: @@ -5080,12 +5080,12 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0): + /vitepress@1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-twpPZ/6UnDR8X0Nmj767KwKhXlTQQM9V/J1i2BP9ryO29/w4hpxBfEum6nvfpNhJ4H3h+cIhwzAK/e9crZ6HEQ==} hasBin: true dependencies: '@docsearch/css': 3.3.4 - '@docsearch/js': 3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.0)(react-dom@18.2.0)(react@18.2.0) + '@docsearch/js': 3.3.4(@algolia/client-search@4.17.0)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) '@vitejs/plugin-vue': 4.2.1(vite@4.3.5)(vue@3.2.47) '@vue/devtools-api': 6.5.0 '@vueuse/core': 10.1.2(vue@3.2.47) From 30b40ada8f9ed8195a7c088c5057d5a9748df897 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Mon, 8 May 2023 10:36:43 +0200 Subject: [PATCH 7/9] docs: minor enhancements (#2131) --- docs/guide/index.md | 16 ++++++++-------- docs/guide/localization.md | 4 +++- docs/guide/usage.md | 19 ++++++++++++------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index cfee521dc27..58a9b974fba 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -21,21 +21,21 @@ You can run Faker in the Browser, within Node, or the many other languages suppo Install it as a Dev Dependency using your favorite package manager. -```shell +::: code-group + +```shell [npm] npm install @faker-js/faker --save-dev ``` -or +```shell [pnpm] +pnpm add @faker-js/faker --save-dev +``` -```shell +```shell [yarn] yarn add @faker-js/faker --dev ``` -or - -```shell -pnpm add @faker-js/faker --save-dev -``` +::: ## Community diff --git a/docs/guide/localization.md b/docs/guide/localization.md index 446c914a29e..af91383b95b 100644 --- a/docs/guide/localization.md +++ b/docs/guide/localization.md @@ -28,7 +28,7 @@ import { faker } from '@faker-js/faker/locale/de'; This will then just load the German locales with additional English locales as fallback. The fallback is required due to not all locales containing data for all features. If you encounter a missing locale entry in your selected language, feel free to open a Pull Request fixing that issue. -::: info +::: info Info The English locales are around 600 KB in size. All locales together are around 5 MB in size. ::: @@ -159,6 +159,7 @@ The recommended way to access Faker instances is by using one of the individual ```ts import { allFakers, allLocales } from '@faker-js/faker'; + console.dir(allFakers['de_AT']); // the prebuilt Faker instance for de_AT console.dir(allLocales['de_AT']); // the raw locale definitions for de_AT ``` @@ -167,6 +168,7 @@ This could be useful if you want to enumerate all locales, for example: ```ts import { allFakers } from '@faker-js/faker'; + for (let key of Object.keys(allFakers)) { try { console.log( diff --git a/docs/guide/usage.md b/docs/guide/usage.md index 767cf747a48..452e415c269 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -4,23 +4,28 @@ Using Faker is as easy as importing it from `@faker-js/faker`. -```js +::: code-group + +```js [esm] import { faker } from '@faker-js/faker'; // or, if desiring a different locale -// import { fakerDE as faker } from '@faker-js/faker' +// import { fakerDE as faker } from '@faker-js/faker'; + const randomName = faker.person.fullName(); // Rowan Nikolaus const randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz ``` -Or if you're using CommonJS: - -```js +```js [cjs] const { faker } = require('@faker-js/faker'); +// or, if desiring a different locale +// const { fakerDE: faker } = require('@faker-js/faker'); const randomName = faker.person.fullName(); // Rowan Nikolaus const randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz ``` +::: + For more information about changing and customizing the locales, please refer to our [Localization Guide](localization). ## Browser @@ -119,7 +124,7 @@ or alternatively you can set a default reference date for all these methods: ```ts // affects all future faker.date.* calls -faker.defaultRefDate = '2023-01-01T00:00:00.000Z'; +faker.setDefaultRefDate('2023-01-01T00:00:00.000Z'); ``` ## Create complex objects @@ -220,7 +225,7 @@ But, in most use-cases, this would be desirable. Faker has your back, with another helper method: -```ts {7-9} +```ts {7-10} import { faker } from '@faker-js/faker'; function createRandomUser(): User { From 1c9043bf5b1ea6cc40f8b5276a996bb2b60b4177 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 14:33:52 +0200 Subject: [PATCH 8/9] chore(deps): update vitest to ~0.31.0 (#2136) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Shinigami92 --- package.json | 6 +-- pnpm-lock.yaml | 106 ++++++++++++++++++++++++-------------- test/vitest-extensions.ts | 13 ++--- 3 files changed, 74 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index 91ff9bc2d97..a42eae5e3c2 100644 --- a/package.json +++ b/package.json @@ -104,8 +104,8 @@ "@types/validator": "~13.7.16", "@typescript-eslint/eslint-plugin": "~5.59.2", "@typescript-eslint/parser": "~5.59.2", - "@vitest/coverage-c8": "~0.30.1", - "@vitest/ui": "~0.30.1", + "@vitest/coverage-c8": "~0.31.0", + "@vitest/ui": "~0.31.0", "@vueuse/core": "~10.1.2", "c8": "~7.13.0", "conventional-changelog-cli": "~2.2.2", @@ -135,7 +135,7 @@ "validator": "~13.9.0", "vite": "~4.3.5", "vitepress": "1.0.0-alpha.75", - "vitest": "~0.30.1", + "vitest": "~0.31.0", "vue": "~3.2.47" }, "packageManager": "pnpm@8.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7f2dc05662..9e4f5afac5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,11 +38,11 @@ devDependencies: specifier: ~5.59.2 version: 5.59.2(eslint@8.40.0)(typescript@4.9.5) '@vitest/coverage-c8': - specifier: ~0.30.1 - version: 0.30.1(vitest@0.30.1) + specifier: ~0.31.0 + version: 0.31.0(vitest@0.31.0) '@vitest/ui': - specifier: ~0.30.1 - version: 0.30.1 + specifier: ~0.31.0 + version: 0.31.0(vitest@0.31.0) '@vueuse/core': specifier: ~10.1.2 version: 10.1.2(vue@3.2.47) @@ -131,8 +131,8 @@ devDependencies: specifier: 1.0.0-alpha.75 version: 1.0.0-alpha.75(@algolia/client-search@4.17.0)(@types/node@18.16.5)(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) vitest: - specifier: ~0.30.1 - version: 0.30.1(@vitest/ui@0.30.1) + specifier: ~0.31.0 + version: 0.31.0(@vitest/ui@0.31.0) vue: specifier: ~3.2.47 version: 3.2.47 @@ -267,6 +267,14 @@ packages: '@algolia/requester-common': 4.17.0 dev: true + /@ampproject/remapping@2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 + dev: true + /@babel/code-frame@7.21.4: resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} engines: {node: '>=6.9.0'} @@ -702,11 +710,25 @@ packages: engines: {node: '>=8'} dev: true + /@jridgewell/gen-mapping@0.3.3: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.18 + dev: true + /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} dev: true + /@jridgewell/set-array@1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true @@ -1097,62 +1119,67 @@ packages: vue: 3.2.47 dev: true - /@vitest/coverage-c8@0.30.1(vitest@0.30.1): - resolution: {integrity: sha512-/Wa3dtSuckpdngAmiCwowaEXXgJkqPrtfvrs9HTB9QoEfNbZWPu4E4cjEn4lJZb4qcGf4fxFtUA2f9DnDNAzBA==} + /@vitest/coverage-c8@0.31.0(vitest@0.31.0): + resolution: {integrity: sha512-h72qN1D962AO7UefQVulm9JFP5ACS7OfhCdBHioXU8f7ohH/+NTZCgAqmgcfRNHHO/8wLFxx+93YVxhodkEJVA==} peerDependencies: vitest: '>=0.30.0 <1' dependencies: + '@ampproject/remapping': 2.2.1 c8: 7.13.0 + magic-string: 0.30.0 picocolors: 1.0.0 std-env: 3.3.3 - vitest: 0.30.1(@vitest/ui@0.30.1) + vitest: 0.31.0(@vitest/ui@0.31.0) dev: true - /@vitest/expect@0.30.1: - resolution: {integrity: sha512-c3kbEtN8XXJSeN81iDGq29bUzSjQhjES2WR3aColsS4lPGbivwLtas4DNUe0jD9gg/FYGIteqOenfU95EFituw==} + /@vitest/expect@0.31.0: + resolution: {integrity: sha512-Jlm8ZTyp6vMY9iz9Ny9a0BHnCG4fqBa8neCF6Pk/c/6vkUk49Ls6UBlgGAU82QnzzoaUs9E/mUhq/eq9uMOv/g==} dependencies: - '@vitest/spy': 0.30.1 - '@vitest/utils': 0.30.1 + '@vitest/spy': 0.31.0 + '@vitest/utils': 0.31.0 chai: 4.3.7 dev: true - /@vitest/runner@0.30.1: - resolution: {integrity: sha512-W62kT/8i0TF1UBCNMRtRMOBWJKRnNyv9RrjIgdUryEe0wNpGZvvwPDLuzYdxvgSckzjp54DSpv1xUbv4BQ0qVA==} + /@vitest/runner@0.31.0: + resolution: {integrity: sha512-H1OE+Ly7JFeBwnpHTrKyCNm/oZgr+16N4qIlzzqSG/YRQDATBYmJb/KUn3GrZaiQQyL7GwpNHVZxSQd6juLCgw==} dependencies: - '@vitest/utils': 0.30.1 + '@vitest/utils': 0.31.0 concordance: 5.0.4 p-limit: 4.0.0 pathe: 1.1.0 dev: true - /@vitest/snapshot@0.30.1: - resolution: {integrity: sha512-fJZqKrE99zo27uoZA/azgWyWbFvM1rw2APS05yB0JaLwUIg9aUtvvnBf4q7JWhEcAHmSwbrxKFgyBUga6tq9Tw==} + /@vitest/snapshot@0.31.0: + resolution: {integrity: sha512-5dTXhbHnyUMTMOujZPB0wjFjQ6q5x9c8TvAsSPUNKjp1tVU7i9pbqcKPqntyu2oXtmVxKbuHCqrOd+Ft60r4tg==} dependencies: magic-string: 0.30.0 pathe: 1.1.0 pretty-format: 27.5.1 dev: true - /@vitest/spy@0.30.1: - resolution: {integrity: sha512-YfJeIf37GvTZe04ZKxzJfnNNuNSmTEGnla2OdL60C8od16f3zOfv9q9K0nNii0NfjDJRt/CVN/POuY5/zTS+BA==} + /@vitest/spy@0.31.0: + resolution: {integrity: sha512-IzCEQ85RN26GqjQNkYahgVLLkULOxOm5H/t364LG0JYb3Apg0PsYCHLBYGA006+SVRMWhQvHlBBCyuByAMFmkg==} dependencies: tinyspy: 2.1.0 dev: true - /@vitest/ui@0.30.1: - resolution: {integrity: sha512-Izz4ElDmdvX02KImSC2nCJI6CsGo9aETbKqxli55M0rbbPPAMtF0zDcJIqgEP5V6Y+4Ysf6wvsjLbLCTnaBvKw==} + /@vitest/ui@0.31.0(vitest@0.31.0): + resolution: {integrity: sha512-Dy86l6r3/dbJposgm7w+oqb/15UWJ0lDBbEQaS1ived3+0CTaMbT8OMkUf9vNBkSL47kvBHEBnZLa5fw5i9gUQ==} + peerDependencies: + vitest: '>=0.30.1 <1' dependencies: - '@vitest/utils': 0.30.1 + '@vitest/utils': 0.31.0 fast-glob: 3.2.12 fflate: 0.7.4 flatted: 3.2.7 pathe: 1.1.0 picocolors: 1.0.0 sirv: 2.0.3 + vitest: 0.31.0(@vitest/ui@0.31.0) dev: true - /@vitest/utils@0.30.1: - resolution: {integrity: sha512-/c8Xv2zUVc+rnNt84QF0Y0zkfxnaGhp87K2dYJMLtLOIckPzuxLVzAtFCicGFdB4NeBHNzTRr1tNn7rCtQcWFA==} + /@vitest/utils@0.31.0: + resolution: {integrity: sha512-kahaRyLX7GS1urekRXN2752X4gIgOGVX4Wo8eDUGUkTWlGpXzf5ZS6N9RUUS+Re3XEE8nVGqNyxkSxF5HXlGhQ==} dependencies: concordance: 5.0.4 loupe: 2.3.6 @@ -4776,8 +4803,8 @@ packages: resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} dev: true - /tinypool@0.4.0: - resolution: {integrity: sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA==} + /tinypool@0.5.0: + resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} engines: {node: '>=14.0.0'} dev: true @@ -5026,8 +5053,8 @@ packages: extsprintf: 1.3.0 dev: true - /vite-node@0.30.1(@types/node@18.16.5): - resolution: {integrity: sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg==} + /vite-node@0.31.0(@types/node@18.16.5): + resolution: {integrity: sha512-8x1x1LNuPvE2vIvkSB7c1mApX5oqlgsxzHQesYF7l5n1gKrEmrClIiZuOFbFDQcjLsmcWSwwmrWrcGWm9Fxc/g==} engines: {node: '>=v14.18.0'} hasBin: true dependencies: @@ -5109,8 +5136,8 @@ packages: - terser dev: true - /vitest@0.30.1(@vitest/ui@0.30.1): - resolution: {integrity: sha512-y35WTrSTlTxfMLttgQk4rHcaDkbHQwDP++SNwPb+7H8yb13Q3cu2EixrtHzF27iZ8v0XCciSsLg00RkPAzB/aA==} + /vitest@0.31.0(@vitest/ui@0.31.0): + resolution: {integrity: sha512-JwWJS9p3GU9GxkG7eBSmr4Q4x4bvVBSswaCFf1PBNHiPx00obfhHRJfgHcnI0ffn+NMlIh9QGvG75FlaIBdKGA==} engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: @@ -5143,12 +5170,12 @@ packages: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 '@types/node': 18.16.5 - '@vitest/expect': 0.30.1 - '@vitest/runner': 0.30.1 - '@vitest/snapshot': 0.30.1 - '@vitest/spy': 0.30.1 - '@vitest/ui': 0.30.1 - '@vitest/utils': 0.30.1 + '@vitest/expect': 0.31.0 + '@vitest/runner': 0.31.0 + '@vitest/snapshot': 0.31.0 + '@vitest/spy': 0.31.0 + '@vitest/ui': 0.31.0(vitest@0.31.0) + '@vitest/utils': 0.31.0 acorn: 8.8.2 acorn-walk: 8.2.0 cac: 6.7.14 @@ -5159,13 +5186,12 @@ packages: magic-string: 0.30.0 pathe: 1.1.0 picocolors: 1.0.0 - source-map: 0.6.1 std-env: 3.3.3 strip-literal: 1.0.1 tinybench: 2.5.0 - tinypool: 0.4.0 + tinypool: 0.5.0 vite: 4.3.5(@types/node@18.16.5) - vite-node: 0.30.1(@types/node@18.16.5) + vite-node: 0.31.0(@types/node@18.16.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/test/vitest-extensions.ts b/test/vitest-extensions.ts index b33919efb00..d8b2f773d5f 100644 --- a/test/vitest-extensions.ts +++ b/test/vitest-extensions.ts @@ -22,12 +22,9 @@ interface CustomMatchers { toContainDuplicates(): void; } -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace Vi { - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface Assertion extends CustomMatchers {} - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface AsymmetricMatchersContaining extends CustomMatchers {} - } +declare module 'vitest' { + // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface Assertion extends CustomMatchers {} + // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface AsymmetricMatchersContaining extends CustomMatchers {} } From aab69c92f05b1d3a08a00ee1adf51a4150a5529b Mon Sep 17 00:00:00 2001 From: Shinigami Date: Tue, 9 May 2023 09:35:36 +0200 Subject: [PATCH 9/9] test: lint vitest (#2098) --- .eslintrc.js | 9 +++++- package.json | 1 + pnpm-lock.yaml | 16 ++++++++++ test/all_functional.spec.ts | 10 +++---- test/commerce.spec.ts | 6 ++-- test/datatype.spec.ts | 6 ++-- test/finance.spec.ts | 28 +++++++---------- test/finance_iban.spec.ts | 2 +- test/helpers.spec.ts | 60 +++++++++++++++++-------------------- test/locale-data.spec.ts | 4 +-- test/locale-proxy.spec.ts | 26 ++++++++-------- test/number.spec.ts | 26 +++++++++++----- test/random.spec.ts | 12 ++++---- test/string.spec.ts | 16 +++++----- test/vehicle.spec.ts | 36 +++++++++++----------- 15 files changed, 139 insertions(+), 119 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6e223951991..a4f8a63baf2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,10 +29,12 @@ module.exports = defineConfig({ rules: { // We may want to use this in the future 'no-useless-escape': 'off', - 'deprecation/deprecation': 'error', eqeqeq: ['error', 'always', { null: 'ignore' }], 'no-else-return': 'error', 'prefer-template': 'error', + + 'deprecation/deprecation': 'error', + '@typescript-eslint/array-type': [ 'error', { default: 'array-simple', readonly: 'generic' }, @@ -112,8 +114,10 @@ module.exports = defineConfig({ }, { files: ['test/*.spec.ts'], + extends: ['plugin:vitest/recommended'], rules: { 'deprecation/deprecation': 'off', + '@typescript-eslint/restrict-template-expressions': [ 'error', { @@ -122,6 +126,9 @@ module.exports = defineConfig({ allowAny: true, }, ], + + 'vitest/expect-expect': 'off', + 'vitest/valid-expect': ['error', { maxArgs: 2 }], }, }, ], diff --git a/package.json b/package.json index a42eae5e3c2..baa19f4cb1a 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "eslint-plugin-deprecation": "~1.4.1", "eslint-plugin-jsdoc": "~44.0.0", "eslint-plugin-prettier": "~4.2.1", + "eslint-plugin-vitest": "~0.2.2", "glob": "~10.2.2", "npm-run-all": "~4.1.5", "picocolors": "~1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e4f5afac5b..557061497ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,6 +79,9 @@ devDependencies: eslint-plugin-prettier: specifier: ~4.2.1 version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.40.0)(prettier@2.8.8) + eslint-plugin-vitest: + specifier: ~0.2.2 + version: 0.2.2(eslint@8.40.0)(typescript@4.9.5) glob: specifier: ~10.2.2 version: 10.2.2 @@ -2458,6 +2461,19 @@ packages: prettier-linter-helpers: 1.0.0 dev: true + /eslint-plugin-vitest@0.2.2(eslint@8.40.0)(typescript@4.9.5): + resolution: {integrity: sha512-f6E90twgtAAuIE8P2YOy4f1RBVbZ0NB9yoyeHSpwYL6xiNxT4fmq6UHZoR4tHN+NMkbtAoZtiTr1EmqSpB2C4A==} + engines: {node: 14.x || >= 16} + peerDependencies: + eslint: '>=8.0.0' + dependencies: + '@typescript-eslint/utils': 5.59.2(eslint@8.40.0)(typescript@4.9.5) + eslint: 8.40.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} diff --git a/test/all_functional.spec.ts b/test/all_functional.spec.ts index f18e5feca68..524862343e6 100644 --- a/test/all_functional.spec.ts +++ b/test/all_functional.spec.ts @@ -138,7 +138,7 @@ describe('BROKEN_LOCALE_METHODS test', () => { }); Object.keys(modules).forEach((module) => { - describe(module, () => { + describe(`${module}`, () => { it('should not contain obsolete configuration (methods)', () => { const existingMethods = modules[module]; const configuredMethods = Object.keys( @@ -157,14 +157,14 @@ describe('BROKEN_LOCALE_METHODS test', () => { describe('functional tests', () => { for (const [locale, faker] of Object.entries(allFakers)) { - describe(locale, () => { + describe(`${locale}`, () => { if (locale === 'base') { it.skip('base locale is checked by other tests'); return; } Object.keys(modules).forEach((module) => { - describe(module, () => { + describe(`${module}`, () => { modules[module].forEach((meth) => { const testAssertion = () => { // TODO @ST-DDT 2022-03-28: Use random seed once there are no more failures @@ -195,14 +195,14 @@ describe('functional tests', () => { describe('faker.helpers.fake functional tests', () => { for (const [locale, faker] of Object.entries(allFakers)) { - describe(locale, () => { + describe(`${locale}`, () => { if (locale === 'base') { it.skip('base locale is checked by other tests'); return; } Object.keys(modules).forEach((module) => { - describe(module, () => { + describe(`${module}`, () => { modules[module].forEach((meth) => { const testAssertion = () => { // TODO @ST-DDT 2022-03-28: Use random seed once there are no more failures diff --git a/test/commerce.spec.ts b/test/commerce.spec.ts index 7d081e497e0..89abd4bbc7a 100644 --- a/test/commerce.spec.ts +++ b/test/commerce.spec.ts @@ -110,16 +110,14 @@ describe('commerce', () => { const price = faker.commerce.price(100, 100, 1); expect(price).toBeTruthy(); - expect(price, 'the price should be equal 100.0').toStrictEqual( - '100.0' - ); + expect(price, 'the price should be equal 100.0').toBe('100.0'); }); it('should handle argument dec = 0', () => { const price = faker.commerce.price(100, 100, 0); expect(price).toBeTruthy(); - expect(price, 'the price should be equal 100').toStrictEqual('100'); + expect(price, 'the price should be equal 100').toBe('100'); }); }); diff --git a/test/datatype.spec.ts b/test/datatype.spec.ts index 2c09ea05a10..ae306b1a583 100644 --- a/test/datatype.spec.ts +++ b/test/datatype.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker } from '../src'; +import { faker, FakerError } from '../src'; import { seededTests } from './support/seededRuns'; const NON_SEEDED_BASED_RUN = 25; @@ -226,7 +226,9 @@ describe('datatype', () => { expect(() => { faker.datatype.number({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }).toThrow( + new FakerError(`Max ${max} should be greater than min ${min}.`) + ); }); }); diff --git a/test/finance.spec.ts b/test/finance.spec.ts index b0a2b8ede6b..da0f7df3d9f 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -265,9 +265,7 @@ describe('finance', () => { amount = faker.finance.amount(100, 100, 1); expect(amount).toBeTruthy(); - expect(amount, 'the amount should be equal 100.0').toStrictEqual( - '100.0' - ); + expect(amount, 'the amount should be equal 100.0').toBe('100.0'); }); //TODO: add support for more currency and decimal options @@ -280,7 +278,7 @@ describe('finance', () => { ).toMatch(/^[0-9\.]+$/); }); - it('it should handle negative amounts', () => { + it('should handle negative amounts', () => { const amount = faker.finance.amount(-200, -1); expect(amount).toBeTruthy(); @@ -292,23 +290,21 @@ describe('finance', () => { ).toBeGreaterThan(-201); }); - it('it should handle argument dec', () => { + it('should handle argument dec', () => { const amount = faker.finance.amount(100, 100, 1); expect(amount).toBeTruthy(); - expect(amount, 'the amount should be equal 100.0').toStrictEqual( - '100.0' - ); + expect(amount, 'the amount should be equal 100.0').toBe('100.0'); }); - it('it should handle argument dec = 0', () => { + it('should handle argument dec = 0', () => { const amount = faker.finance.amount(100, 100, 0); expect(amount).toBeTruthy(); - expect(amount, 'the amount should be equal 100').toStrictEqual('100'); + expect(amount, 'the amount should be equal 100').toBe('100'); }); - it('it should return a string', () => { + it('should return a string', () => { const amount = faker.finance.amount(100, 100, 0); expect(amount).toBeTruthy(); @@ -542,9 +538,7 @@ describe('finance', () => { }); it('should throw an error when length is less than 1', () => { - expect(() => faker.finance.pin(-5)).toThrowError( - /^minimum length is 1$/ - ); + expect(() => faker.finance.pin(-5)).toThrow(/^minimum length is 1$/); }); }); @@ -565,7 +559,7 @@ describe('finance', () => { expect( ibanLib.mod97(ibanLib.toDigitString(bban)), 'the result should be equal to 1' - ).toStrictEqual(1); + ).toBe(1); }); it('should return a specific and formally correct IBAN number', () => { @@ -577,7 +571,7 @@ describe('finance', () => { expect( ibanLib.mod97(ibanLib.toDigitString(bban)), 'the result should be equal to 1' - ).toStrictEqual(1); + ).toBe(1); }); it.each(['AA', 'EU'])( @@ -585,7 +579,7 @@ describe('finance', () => { (unsupportedCountryCode) => expect(() => faker.finance.iban(false, unsupportedCountryCode) - ).toThrowError( + ).toThrow( new FakerError( `Country code ${unsupportedCountryCode} not supported.` ) diff --git a/test/finance_iban.spec.ts b/test/finance_iban.spec.ts index c387a23ae6d..1194a73a48a 100644 --- a/test/finance_iban.spec.ts +++ b/test/finance_iban.spec.ts @@ -303,7 +303,7 @@ describe('finance_iban', () => { 0, 2 )}must start with 'CR' in CR IBAN ${ibanFormated}` - ).to.eq('CR'); + ).toBe('CR'); expect( iban.substring(2, 22), diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts index 437a3284b2c..e77435df175 100644 --- a/test/helpers.spec.ts +++ b/test/helpers.spec.ts @@ -212,7 +212,7 @@ describe('helpers', () => { it('should throw with no arguments', () => { // @ts-expect-error: `arrayElement` without arguments is not supported in TypeScript - expect(() => faker.helpers.arrayElement()).toThrowError( + expect(() => faker.helpers.arrayElement()).toThrow( new FakerError( 'Calling `faker.helpers.arrayElement()` without arguments is no longer supported.' ) @@ -221,7 +221,7 @@ describe('helpers', () => { it('should throw on an empty array', () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-return - expect(() => faker.helpers.arrayElement([])).toThrowError( + expect(() => faker.helpers.arrayElement([])).toThrow( new FakerError('Cannot get value from empty dataset.') ); }); @@ -230,7 +230,7 @@ describe('helpers', () => { it.each(['', 0, undefined, null, false])('%s', (nullishValue) => { expect(() => faker.helpers.arrayElement([nullishValue]) - ).not.toThrowError(); + ).not.toThrow(); }); }); }); @@ -314,7 +314,7 @@ describe('helpers', () => { }); it('should throw if the array is empty', () => { - expect(() => faker.helpers.weightedArrayElement([])).toThrowError( + expect(() => faker.helpers.weightedArrayElement([])).toThrow( new FakerError( 'weightedArrayElement expects an array with at least one element' ) @@ -332,9 +332,7 @@ describe('helpers', () => { { weight: 0, value: 'hello' }, { weight: 5, value: 'to' }, ]; - expect(() => - faker.helpers.weightedArrayElement(testArray) - ).toThrowError( + expect(() => faker.helpers.weightedArrayElement(testArray)).toThrow( new FakerError( 'weightedArrayElement expects an array of { weight, value } objects where weight is a positive number' ) @@ -346,9 +344,7 @@ describe('helpers', () => { { weight: -1, value: 'hello' }, { weight: 5, value: 'to' }, ]; - expect(() => - faker.helpers.weightedArrayElement(testArray) - ).toThrowError( + expect(() => faker.helpers.weightedArrayElement(testArray)).toThrow( new FakerError( 'weightedArrayElement expects an array of { weight, value } objects where weight is a positive number' ) @@ -363,7 +359,7 @@ describe('helpers', () => { const frozenArray = Object.freeze(testArray); expect(() => faker.helpers.weightedArrayElement(frozenArray) - ).to.not.throw(); + ).not.toThrow(); }); }); @@ -426,7 +422,7 @@ describe('helpers', () => { const subset = faker.helpers.arrayElements(testArray, 6); // Check length - expect(subset.length).toEqual(5); + expect(subset.length).toBe(5); // Check elements subset.forEach((element) => { @@ -494,7 +490,7 @@ describe('helpers', () => { it('should throw with no arguments', () => { // @ts-expect-error: `arrayElements` without arguments is not supported in TypeScript - expect(() => faker.helpers.arrayElements()).toThrowError( + expect(() => faker.helpers.arrayElements()).toThrow( new FakerError( 'Calling `faker.helpers.arrayElements()` without arguments is no longer supported.' ) @@ -508,7 +504,7 @@ describe('helpers', () => { [nullishValue, nullishValue, nullishValue], 2 ) - ).not.toThrowError(); + ).not.toThrow(); }); }); }); @@ -711,7 +707,7 @@ describe('helpers', () => { it('mutates the input array in place', () => { const input = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']; const shuffled = faker.helpers.shuffle(input, { inplace: true }); - expect(shuffled).deep.eq(input); + expect(shuffled).toStrictEqual(input); }); it('does not mutate the input array by default', () => { @@ -727,7 +723,7 @@ describe('helpers', () => { 'i', 'j', ]); - expect(() => faker.helpers.shuffle(input)).not.to.throw(); + expect(() => faker.helpers.shuffle(input)).not.toThrow(); }); it('does not mutate the input array when inplace is false', () => { @@ -745,7 +741,7 @@ describe('helpers', () => { ]); expect(() => faker.helpers.shuffle(input, { inplace: false }) - ).not.to.throw(); + ).not.toThrow(); }); it('throws an error when the input array is readonly and inplace is true', () => { @@ -764,7 +760,7 @@ describe('helpers', () => { expect(() => // @ts-expect-error: we want to test that it throws faker.helpers.shuffle(input, { inplace: true }) - ).to.throw(); + ).toThrow(); }); }); @@ -813,7 +809,7 @@ describe('helpers', () => { const length = 5; faker.seed(100); const unique = faker.helpers.uniqueArray(input, length); - expect(unique).deep.eq(['g', 'a', 'i', 'f', 'j']); + expect(unique).toStrictEqual(['g', 'a', 'i', 'f', 'j']); }); }); @@ -914,7 +910,7 @@ describe('helpers', () => { }); it('should throw if given object is empty', () => { - expect(() => faker.helpers.objectKey({})).toThrowError( + expect(() => faker.helpers.objectKey({})).toThrow( new FakerError('Cannot get value from empty dataset.') ); }); @@ -933,7 +929,7 @@ describe('helpers', () => { }); it('should throw if given object is empty', () => { - expect(() => faker.helpers.objectValue({})).toThrowError( + expect(() => faker.helpers.objectValue({})).toThrow( new FakerError('Cannot get value from empty dataset.') ); }); @@ -954,7 +950,7 @@ describe('helpers', () => { }); it('should throw if given object is empty', () => { - expect(() => faker.helpers.objectEntry({})).toThrowError( + expect(() => faker.helpers.objectEntry({})).toThrow( new FakerError('Cannot get value from empty dataset.') ); }); @@ -1014,13 +1010,13 @@ describe('helpers', () => { }); it('should throw with empty array parameters', () => { - expect(() => faker.helpers.fake([])).toThrowError( + expect(() => faker.helpers.fake([])).toThrow( new FakerError('Cannot get value from empty dataset.') ); }); it('does not allow invalid module name', () => { - expect(() => faker.helpers.fake('{{foo.bar}}')).toThrowError( + expect(() => faker.helpers.fake('{{foo.bar}}')).toThrow( new FakerError(`Invalid module method or definition: foo.bar - faker.foo.bar is not a function - faker.definitions.foo.bar is not an array`) @@ -1028,7 +1024,7 @@ describe('helpers', () => { }); it('does not allow missing method name', () => { - expect(() => faker.helpers.fake('{{location}}')).toThrowError( + expect(() => faker.helpers.fake('{{location}}')).toThrow( new FakerError(`Invalid module method or definition: location - faker.location is not a function - faker.definitions.location is not an array`) @@ -1036,7 +1032,7 @@ describe('helpers', () => { }); it('does not allow invalid method name', () => { - expect(() => faker.helpers.fake('{{location.foo}}')).toThrowError( + expect(() => faker.helpers.fake('{{location.foo}}')).toThrow( new FakerError(`Invalid module method or definition: location.foo - faker.location.foo is not a function - faker.definitions.location.foo is not an array`) @@ -1044,9 +1040,7 @@ describe('helpers', () => { }); it('does not allow invalid definitions data', () => { - expect(() => - faker.helpers.fake('{{finance.credit_card}}') - ).toThrowError( + expect(() => faker.helpers.fake('{{finance.credit_card}}')).toThrow( new FakerError(`Invalid module method or definition: finance.credit_card - faker.finance.credit_card is not a function - faker.definitions.finance.credit_card is not an array`) @@ -1182,7 +1176,7 @@ describe('helpers', () => { maxRetries: 9999, exclude: ['https', 'http'], }); - }).toThrowError( + }).toThrow( new FakerError(`Exceeded maxTime: 1 for uniqueness check. May not be able to generate any more unique values with current settings. @@ -1197,7 +1191,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().`) maxRetries: 5, exclude: ['https', 'http'], }); - }).toThrowError( + }).toThrow( new FakerError(`Exceeded maxRetries: 5 for uniqueness check. May not be able to generate any more unique values with current settings. @@ -1212,7 +1206,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().`) maxRetries: 5, exclude: ['https', 'http'], }); - }).toThrowError( + }).toThrow( new FakerError(`Exceeded maxRetries: 5 for uniqueness check. May not be able to generate any more unique values with current settings. @@ -1248,7 +1242,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().`) faker.helpers.unique(method, [], { maxRetries: 1, }) - ).toThrowError( + ).toThrow( new FakerError(`Exceeded maxRetries: 1 for uniqueness check. May not be able to generate any more unique values with current settings. diff --git a/test/locale-data.spec.ts b/test/locale-data.spec.ts index 3b9a2dd3879..8698125e742 100644 --- a/test/locale-data.spec.ts +++ b/test/locale-data.spec.ts @@ -9,12 +9,12 @@ function checkLocaleData(data: unknown) { }); } else if (typeof data === 'object' && data != null) { for (const [nestedKey, nestedData] of Object.entries(data)) { - describe(nestedKey, () => { + describe(`${nestedKey}`, () => { checkLocaleData(nestedData); }); } } else { - it.skip(`primitives cannot be tested`); + it.skip('primitives cannot be tested'); } } diff --git a/test/locale-proxy.spec.ts b/test/locale-proxy.spec.ts index 6faf6ac0b2c..ce82744adfa 100644 --- a/test/locale-proxy.spec.ts +++ b/test/locale-proxy.spec.ts @@ -37,7 +37,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. locale.category = {}; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -46,7 +46,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. locale.airline = {}; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -55,7 +55,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. delete locale.category; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -64,7 +64,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. delete locale.airline; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -94,7 +94,7 @@ describe('LocaleProxy', () => { }); it('should not be possible to access a missing entry in a missing category', () => { - expect(() => locale.category.missing).toThrowError( + expect(() => locale.category.missing).toThrow( new FakerError( `The locale data for 'category.missing' are missing in this locale. Please contribute the missing data to the project or use a locale/Faker instance that has these data. @@ -104,7 +104,7 @@ describe('LocaleProxy', () => { }); it('should not be possible to access a missing entry in a present category', () => { - expect(() => locale.airline.missing).toThrowError( + expect(() => locale.airline.missing).toThrow( new FakerError( `The locale data for 'airline.missing' are missing in this locale. Please contribute the missing data to the project or use a locale/Faker instance that has these data. @@ -122,7 +122,7 @@ describe('LocaleProxy', () => { airline: { airline: null }, }); - expect(() => unavailable.airline.airline).toThrowError( + expect(() => unavailable.airline.airline).toThrow( new FakerError( `The locale data for 'airline.airline' aren't applicable to this locale. If you think this is a bug, please report it at: https://github.com/faker-js/faker` @@ -134,7 +134,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. locale.category.missing = {}; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -143,7 +143,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. locale.airline.missing = {}; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -152,7 +152,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. locale.airline.airline = ['dummy']; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -161,7 +161,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. delete locale.category.missing; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -170,7 +170,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. delete locale.airline.missing; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); @@ -179,7 +179,7 @@ describe('LocaleProxy', () => { expect(() => { // @ts-expect-error: LocaleProxy is read-only. delete locale.airline.airline; - }).toThrowError( + }).toThrow( new FakerError('You cannot edit the locale data on the faker instance') ); }); diff --git a/test/number.spec.ts b/test/number.spec.ts index 7409ab09607..c0bdf609de6 100644 --- a/test/number.spec.ts +++ b/test/number.spec.ts @@ -151,7 +151,9 @@ describe('number', () => { expect(() => { faker.number.int({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }).toThrow( + new FakerError(`Max ${max} should be greater than min ${min}.`) + ); }); it('should throw when there is no integer between min and max', () => { @@ -268,13 +270,13 @@ describe('number', () => { }); it('throws an error for precision 0', () => { - expect(() => faker.number.float({ precision: 0 })).toThrowError( + expect(() => faker.number.float({ precision: 0 })).toThrow( new FakerError('Precision should be greater than 0.') ); }); it('throws an error for negative precision', () => { - expect(() => faker.number.float({ precision: -0.01 })).toThrowError( + expect(() => faker.number.float({ precision: -0.01 })).toThrow( new FakerError('Precision should be greater than 0.') ); }); @@ -291,7 +293,9 @@ describe('number', () => { expect(() => { faker.number.float({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }).toThrow( + new FakerError(`Max ${max} should be greater than min ${min}.`) + ); }); }); @@ -336,7 +340,9 @@ describe('number', () => { expect(() => { faker.number.binary({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }).toThrow( + new FakerError(`Max ${max} should be greater than min ${min}.`) + ); }); }); @@ -377,7 +383,9 @@ describe('number', () => { expect(() => { faker.number.octal({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }).toThrow( + new FakerError(`Max ${max} should be greater than min ${min}.`) + ); }); }); @@ -415,7 +423,9 @@ describe('number', () => { expect(() => { faker.number.hex({ min, max }); - }).toThrowError(`Max ${max} should be greater than min ${min}.`); + }).toThrow( + new FakerError(`Max ${max} should be greater than min ${min}.`) + ); }); }); @@ -491,7 +501,7 @@ describe('number', () => { expect(() => { faker.number.bigInt({ min, max }); - }).toThrowError( + }).toThrow( new FakerError(`Max ${max} should be larger then min ${min}.`) ); }); diff --git a/test/random.spec.ts b/test/random.spec.ts index 2f06f3b5ed7..354490a1da3 100644 --- a/test/random.spec.ts +++ b/test/random.spec.ts @@ -87,7 +87,7 @@ describe('random', () => { locale: [{ metadata: { title: 'custom' } }], }); - expect(() => faker.random.word()).toThrowError(); + expect(() => faker.random.word()).toThrow(); }); }); @@ -200,7 +200,7 @@ describe('random', () => { count: 5, bannedChars, }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -319,7 +319,7 @@ describe('random', () => { bannedChars, casing: 'lower', }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -333,7 +333,7 @@ describe('random', () => { bannedChars, casing: 'lower', }) - ).toThrowError(); + ).toThrow(); }); it('should not mutate the input object', () => { @@ -416,7 +416,7 @@ describe('random', () => { allowLeadingZeros: false, bannedDigits: '123456789'.split(''), }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate numeric string, because all possible digits are excluded.' ) @@ -429,7 +429,7 @@ describe('random', () => { allowLeadingZeros: false, bannedDigits: '123456789', }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate numeric string, because all possible digits are excluded.' ) diff --git a/test/string.spec.ts b/test/string.spec.ts index c3da56f1005..aabcd6be057 100644 --- a/test/string.spec.ts +++ b/test/string.spec.ts @@ -170,7 +170,7 @@ describe('string', () => { }); it('should throw if no characters are passed (string)', () => { - expect(() => faker.string.fromCharacters('')).toThrowError( + expect(() => faker.string.fromCharacters('')).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -178,7 +178,7 @@ describe('string', () => { }); it('should throw if no characters are passed (string[])', () => { - expect(() => faker.string.fromCharacters([])).toThrowError( + expect(() => faker.string.fromCharacters([])).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -274,7 +274,7 @@ describe('string', () => { casing: 'lower', exclude, }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -289,7 +289,7 @@ describe('string', () => { casing: 'lower', exclude, }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -428,7 +428,7 @@ describe('string', () => { casing: 'lower', exclude, }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -443,7 +443,7 @@ describe('string', () => { casing: 'lower', exclude, }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate string: No characters to select from.' ) @@ -667,7 +667,7 @@ describe('string', () => { allowLeadingZeros: false, exclude: '123456789'.split(''), }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate numeric string, because all possible digits are excluded.' ) @@ -681,7 +681,7 @@ describe('string', () => { allowLeadingZeros: false, exclude: '123456789', }) - ).toThrowError( + ).toThrow( new FakerError( 'Unable to generate numeric string, because all possible digits are excluded.' ) diff --git a/test/vehicle.spec.ts b/test/vehicle.spec.ts index 282626471df..d6718426441 100644 --- a/test/vehicle.spec.ts +++ b/test/vehicle.spec.ts @@ -43,15 +43,6 @@ describe('vehicle', () => { }); }); - describe('vin()', () => { - it('returns valid vin number', () => { - const vin = faker.vehicle.vin(); - expect(vin).toMatch( - /^([A-HJ-NPR-Z0-9]{10}[A-HJ-NPR-Z0-9]{1}[A-HJ-NPR-Z0-9]{1}\d{5})$/ - ); - }); - }); - describe('model()', () => { it('should return random vehicle model', () => { const model = faker.vehicle.model(); @@ -82,7 +73,24 @@ describe('vehicle', () => { }); }); + describe('color()', () => { + it('should return a random color', () => { + const color = faker.vehicle.color(); + + expect(color).toBeTruthy(); + expect(color).toBeTypeOf('string'); + expect(faker.definitions.color.human).toContain(color); + }); + }); + describe('vin()', () => { + it('returns valid vin number', () => { + const vin = faker.vehicle.vin(); + expect(vin).toMatch( + /^([A-HJ-NPR-Z0-9]{10}[A-HJ-NPR-Z0-9]{1}[A-HJ-NPR-Z0-9]{1}\d{5})$/ + ); + }); + it('should return valid vin number', () => { const vin = faker.vehicle.vin(); @@ -94,16 +102,6 @@ describe('vehicle', () => { }); }); - describe('color()', () => { - it('should return a random color', () => { - const color = faker.vehicle.color(); - - expect(color).toBeTruthy(); - expect(color).toBeTypeOf('string'); - expect(faker.definitions.color.human).toContain(color); - }); - }); - describe('vrm()', () => { it('should return a random vrm', () => { const vrm = faker.vehicle.vrm();