Skip to content

Commit cc9c202

Browse files
authored
Merge branch 'next' into next
2 parents 1e4f57d + 2d591de commit cc9c202

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1120
-963
lines changed

.eslintrc.js

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,74 +15,55 @@ module.exports = defineConfig({
1515
reportUnusedDisableDirectives: true,
1616
extends: [
1717
'eslint:recommended',
18-
'plugin:@typescript-eslint/recommended',
1918
'plugin:@typescript-eslint/recommended-type-checked',
2019
'plugin:prettier/recommended',
20+
'plugin:deprecation/recommended',
2121
'plugin:jsdoc/recommended-typescript-error',
2222
'plugin:unicorn/recommended',
2323
],
24-
parser: '@typescript-eslint/parser',
2524
parserOptions: {
2625
project: ['./tsconfig.json'],
27-
sourceType: 'module',
2826
warnOnUnsupportedTypeScriptVersion: false,
2927
},
30-
plugins: ['@typescript-eslint', 'prettier', 'deprecation', 'jsdoc'],
3128
rules: {
3229
eqeqeq: ['error', 'always', { null: 'ignore' }],
3330
'no-else-return': 'error',
34-
'prefer-template': 'error',
3531
'no-restricted-globals': ['error', 'Intl'],
36-
37-
'deprecation/deprecation': 'error',
32+
'prefer-template': 'error',
3833

3934
'unicorn/no-nested-ternary': 'off', // incompatible with prettier
4035
'unicorn/no-null': 'off', // incompatible with TypeScript
36+
'unicorn/no-zero-fractions': 'off', // deactivated to raise awareness of floating operations
4137
'unicorn/number-literal-case': 'off', // incompatible with prettier
38+
'unicorn/prefer-ternary': 'off', // ternaries aren't always better
4239

4340
// TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14.
4441
'unicorn/prefer-at': 'off',
4542
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14.
4643
'unicorn/prefer-string-replace-all': 'off',
44+
// TODO @ST-DDT 2023-10-28: The following rule should be turned on when we switch to esm.
45+
'unicorn/prefer-top-level-await': 'off',
4746

4847
// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
4948
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
5049
'unicorn/better-regex': 'off',
51-
'unicorn/catch-error-name': 'off',
52-
'unicorn/consistent-destructuring': 'off',
5350
'unicorn/consistent-function-scoping': 'off',
54-
'unicorn/escape-case': 'off',
55-
'unicorn/explicit-length-check': 'off',
56-
'unicorn/filename-case': 'off',
5751
'unicorn/import-style': 'off',
5852
'unicorn/no-array-callback-reference': 'off',
59-
'unicorn/no-array-for-each': 'off',
6053
'unicorn/no-array-reduce': 'off',
6154
'unicorn/no-await-expression-member': 'off',
62-
'unicorn/no-for-loop': 'off',
63-
'unicorn/no-instanceof-array': 'off',
6455
'unicorn/no-negated-condition': 'off',
6556
'unicorn/no-object-as-default-parameter': 'off',
6657
'unicorn/no-useless-switch-case': 'off',
67-
'unicorn/no-zero-fractions': 'off',
6858
'unicorn/numeric-separators-style': 'off',
69-
'unicorn/prefer-array-some': 'off',
7059
'unicorn/prefer-code-point': 'off',
7160
'unicorn/prefer-export-from': 'off',
72-
'unicorn/prefer-includes': 'off',
7361
'unicorn/prefer-module': 'off',
74-
'unicorn/prefer-native-coercion-functions': 'off',
7562
'unicorn/prefer-negative-index': 'off',
76-
'unicorn/prefer-number-properties': 'off',
77-
'unicorn/prefer-optional-catch-binding': 'off',
78-
'unicorn/prefer-spread': 'off',
7963
'unicorn/prefer-string-slice': 'off',
80-
'unicorn/prefer-ternary': 'off',
81-
'unicorn/prefer-top-level-await': 'off',
8264
'unicorn/prevent-abbreviations': 'off',
8365
'unicorn/require-array-join-separator': 'off',
8466
'unicorn/switch-case-braces': 'off',
85-
'unicorn/text-encoding-identifier-case': 'off',
8667

8768
'@typescript-eslint/array-type': [
8869
'error',
@@ -110,23 +91,21 @@ module.exports = defineConfig({
11091
'error',
11192
{ ignoreParameters: true },
11293
],
113-
'@typescript-eslint/no-unsafe-argument': 'error',
11494
'@typescript-eslint/no-unsafe-assignment': 'off',
11595
'@typescript-eslint/no-unsafe-call': 'off',
11696
'@typescript-eslint/no-unsafe-member-access': 'off',
117-
'@typescript-eslint/no-unsafe-return': 'error',
11897
'@typescript-eslint/padding-line-between-statements': [
11998
'error',
12099
{ blankLine: 'always', prev: 'block-like', next: '*' },
121100
],
101+
'@typescript-eslint/prefer-regexp-exec': 'error',
122102
'@typescript-eslint/restrict-template-expressions': [
123103
'error',
124104
{ allowNumber: true, allowBoolean: true },
125105
],
126106
'@typescript-eslint/unbound-method': 'off',
127107

128-
'jsdoc/no-types': 'error',
129-
'jsdoc/require-jsdoc': 'off',
108+
'jsdoc/require-jsdoc': 'off', // Enabled only for src/**/*.ts
130109
'jsdoc/require-returns': 'off',
131110
'jsdoc/sort-tags': [
132111
'error',
@@ -159,6 +138,30 @@ module.exports = defineConfig({
159138
'jsdoc/require-jsdoc': 'error',
160139
},
161140
},
141+
{
142+
files: ['src/locale/**/*.ts'],
143+
rules: {
144+
'unicorn/filename-case': 'off', // our locale files have a custom naming scheme
145+
},
146+
},
147+
{
148+
files: ['src/definitions/**/*.ts', 'src/locales/**/*.ts'],
149+
rules: {
150+
'unicorn/filename-case': [
151+
'error',
152+
{
153+
case: 'snakeCase',
154+
// TODO @ST-DDT 2023-10-21: rename the definitions in v9
155+
ignore: [
156+
/chemicalElement\.ts$/,
157+
/directoryPaths\.ts$/,
158+
/mimeTypes\.ts$/,
159+
],
160+
},
161+
],
162+
'unicorn/text-encoding-identifier-case': 'off',
163+
},
164+
},
162165
{
163166
files: ['test/**/*.spec.ts'],
164167
extends: ['plugin:vitest/recommended'],

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
3636
steps:
3737
- name: Checkout
38-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
38+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
3939
with:
4040
# Required for docs/versions tests
4141
fetch-depth: 0
@@ -51,7 +51,7 @@ jobs:
5151
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
5252

5353
- name: Set node version to ${{ matrix.node_version }}
54-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
54+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
5555
with:
5656
node-version: ${{ matrix.node_version }}
5757
cache: 'pnpm'
@@ -90,7 +90,7 @@ jobs:
9090
run: date
9191

9292
- name: Checkout
93-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
93+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
9494
with:
9595
# Required for docs/versions tests
9696
fetch-depth: 0
@@ -99,7 +99,7 @@ jobs:
9999
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
100100

101101
- name: Set node version to ${{ matrix.node_version }}
102-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
102+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
103103
with:
104104
node-version: ${{ matrix.node_version }}
105105
cache: 'pnpm'
@@ -124,7 +124,7 @@ jobs:
124124
name: 'E2E Doc Test: node-20, ubuntu-latest'
125125
steps:
126126
- name: Checkout
127-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
127+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
128128

129129
- name: Install pnpm
130130
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
@@ -145,15 +145,15 @@ jobs:
145145
name: 'Lint: node-20, ubuntu-latest'
146146
steps:
147147
- name: Checkout
148-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
148+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
149149
with:
150150
fetch-depth: 0
151151

152152
- name: Install pnpm
153153
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
154154

155155
- name: Set node version to 20
156-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
156+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
157157
with:
158158
node-version: 20
159159
cache: 'pnpm'
@@ -175,15 +175,15 @@ jobs:
175175
name: 'TS-Check: node-20, ubuntu-latest'
176176
steps:
177177
- name: Checkout
178-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
178+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
179179
with:
180180
fetch-depth: 0
181181

182182
- name: Install pnpm
183183
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
184184

185185
- name: Set node version to 20
186-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
186+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
187187
with:
188188
node-version: 20
189189
cache: 'pnpm'
@@ -202,15 +202,15 @@ jobs:
202202
name: 'Codecov: node-20, ubuntu-latest'
203203
steps:
204204
- name: Checkout
205-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
205+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
206206
with:
207207
fetch-depth: 0
208208

209209
- name: Install pnpm
210210
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
211211

212212
- name: Set node version to 20
213-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
213+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
214214
with:
215215
node-version: 20
216216
cache: 'pnpm'

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
pull-requests: write
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
18+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Install pnpm
2323
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
2424

2525
- name: Set node version to 20
26-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
26+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
2727
with:
2828
node-version: 20
2929
cache: 'pnpm'

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [8.2.0](https://github.com/faker-js/faker/compare/v8.1.0...v8.2.0) (2023-10-14)
6+
7+
8+
### Features
9+
10+
* support custom randomizer ([#2284](https://github.com/faker-js/faker/issues/2284)) ([5410239](https://github.com/faker-js/faker/commit/5410239245b4a6fe8c1976f8aa33c970923f9f40))
11+
12+
13+
### Bug Fixes
14+
15+
* **docs:** revert filter code that breaks search in docs ([#2425](https://github.com/faker-js/faker/issues/2425)) ([c498c09](https://github.com/faker-js/faker/commit/c498c091f488db287684690ab4ff109b1589523f))
16+
* **locale:** Dutch phone number ([#2400](https://github.com/faker-js/faker/issues/2400)) ([005369b](https://github.com/faker-js/faker/commit/005369b29c7ee290a870396ff0acc85e3f715e10))
17+
18+
19+
### New Locales
20+
21+
* **locale:** add airline database science commerce and vehicle for zh_CN ([#2395](https://github.com/faker-js/faker/issues/2395)) ([9c96c0a](https://github.com/faker-js/faker/commit/9c96c0a131e0609a21dc5ee110cc407e76852373))
22+
* **locale:** add street_name to `en_US`, `en_GB` and `en` ([#2371](https://github.com/faker-js/faker/issues/2371)) ([491d319](https://github.com/faker-js/faker/commit/491d3191213e2ceaaee46dcc50ac25c3995ba2d5))
23+
* **locale:** add unionpay credit card for zh_CN ([#2338](https://github.com/faker-js/faker/issues/2338)) ([74eeccc](https://github.com/faker-js/faker/commit/74eecccd3af702d8a1d8072f94032ccb54293cb1))
24+
525
## [8.1.0](https://github.com/faker-js/faker/compare/v8.0.2...v8.1.0) (2023-09-19)
626

727

docs/guide/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ interface User {
168168
}
169169
```
170170

171-
As you can see, your `User` model probably looks completely different from the one you have in your codebase.
171+
As you can see, our `User` model probably looks completely different from the one you have in your codebase.
172172
One thing to keep an eye on is the `subscriptionTier` property, as it is not simply a string, but only one of the strings defined in the `SubscriptionTier` type (`'free'` or `'basic'` or `'business'`).
173173
Also, in a real scenario, your model should not depend on a type of a third party library (`SexType` in this case).
174174

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@faker-js/faker",
3-
"version": "8.1.0",
3+
"version": "8.2.0",
44
"description": "Generate massive amounts of fake contextual data",
55
"keywords": [
66
"faker",
@@ -63,7 +63,7 @@
6363
"build": "run-s build:clean build:code build:types",
6464
"generate": "run-s generate:locales generate:api-docs",
6565
"generate:api-docs": "tsx ./scripts/apidoc.ts",
66-
"generate:locales": "tsx ./scripts/generateLocales.ts",
66+
"generate:locales": "tsx ./scripts/generate-locales.ts",
6767
"docs:build": "run-s docs:prepare docs:build:run",
6868
"docs:build:run": "vitepress build docs",
6969
"docs:build:ci": "run-s build docs:build",
@@ -87,30 +87,30 @@
8787
"preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check"
8888
},
8989
"devDependencies": {
90-
"@actions/github": "~5.1.1",
90+
"@actions/github": "~6.0.0",
9191
"@algolia/client-search": "~4.19.1",
92-
"@types/markdown-it": "~13.0.2",
93-
"@types/node": "~20.8.3",
94-
"@types/sanitize-html": "~2.9.1",
95-
"@types/semver": "~7.5.3",
96-
"@types/validator": "~13.11.2",
97-
"@typescript-eslint/eslint-plugin": "~6.7.4",
98-
"@typescript-eslint/parser": "~6.7.4",
92+
"@types/markdown-it": "~13.0.4",
93+
"@types/node": "~20.8.7",
94+
"@types/sanitize-html": "~2.9.3",
95+
"@types/semver": "~7.5.4",
96+
"@types/validator": "~13.11.5",
97+
"@typescript-eslint/eslint-plugin": "~6.9.0",
98+
"@typescript-eslint/parser": "~6.9.0",
9999
"@vitest/coverage-v8": "~0.34.6",
100100
"@vitest/ui": "~0.34.7",
101101
"@vueuse/core": "~10.5.0",
102102
"conventional-changelog-cli": "~4.1.0",
103-
"cypress": "~13.3.0",
104-
"esbuild": "~0.19.4",
105-
"eslint": "~8.51.0",
103+
"cypress": "~13.3.2",
104+
"esbuild": "~0.19.5",
105+
"eslint": "~8.52.0",
106106
"eslint-config-prettier": "~9.0.0",
107107
"eslint-define-config": "~1.24.1",
108108
"eslint-gitignore": "~0.1.0",
109109
"eslint-plugin-deprecation": "~2.0.0",
110110
"eslint-plugin-jsdoc": "~46.8.2",
111-
"eslint-plugin-prettier": "~5.0.0",
112-
"eslint-plugin-unicorn": "~48.0.1",
113-
"eslint-plugin-vitest": "~0.3.2",
111+
"eslint-plugin-prettier": "~5.0.1",
112+
"eslint-plugin-unicorn": "~49.0.0",
113+
"eslint-plugin-vitest": "~0.3.8",
114114
"glob": "~10.3.10",
115115
"npm-run-all": "~4.1.5",
116116
"prettier": "3.0.3",
@@ -123,10 +123,10 @@
123123
"typedoc": "~0.24.8",
124124
"typescript": "~4.9.5",
125125
"validator": "~13.11.0",
126-
"vite": "~4.4.11",
126+
"vite": "~4.5.0",
127127
"vitepress": "1.0.0-beta.7",
128128
"vitest": "~0.34.6",
129-
"vue": "~3.3.4"
129+
"vue": "~3.3.6"
130130
},
131131
"packageManager": "[email protected]",
132132
"engines": {

0 commit comments

Comments
 (0)