Skip to content

Commit f2a752f

Browse files
Merge branch 'next' into refactor/location/decouple-direction-data-index-from-representation-value
2 parents 22604e3 + 501f4b3 commit f2a752f

786 files changed

Lines changed: 19574 additions & 57356 deletions

File tree

Some content is hidden

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

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { readGitignoreFiles } = require('eslint-gitignore');
1111
module.exports = defineConfig({
1212
ignorePatterns: [
1313
...readGitignoreFiles(),
14-
'.eslintrc.js', // Skip self linting
14+
'.eslintrc.cjs', // Skip self linting
1515
],
1616
root: true,
1717
env: {
@@ -33,44 +33,37 @@ module.exports = defineConfig({
3333
},
3434
rules: {
3535
eqeqeq: ['error', 'always', { null: 'ignore' }],
36+
'logical-assignment-operators': 'error',
3637
'no-else-return': 'error',
3738
'no-restricted-globals': ['error', 'Intl'],
3839
'prefer-exponentiation-operator': 'error',
3940
'prefer-template': 'error',
4041

42+
'unicorn/no-array-callback-reference': 'off', // reduces readability
4143
'unicorn/no-nested-ternary': 'off', // incompatible with prettier
4244
'unicorn/no-null': 'off', // incompatible with TypeScript
4345
'unicorn/no-zero-fractions': 'off', // deactivated to raise awareness of floating operations
4446
'unicorn/number-literal-case': 'off', // incompatible with prettier
4547
'unicorn/prefer-ternary': 'off', // ternaries aren't always better
4648

47-
// TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14.
48-
'unicorn/prefer-at': 'off',
49-
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14.
50-
'unicorn/prefer-string-replace-all': 'off',
51-
// TODO @ST-DDT 2023-10-28: The following rule should be turned on when we switch to esm.
52-
'unicorn/prefer-top-level-await': 'off',
53-
5449
// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
5550
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
5651
'unicorn/better-regex': 'off',
5752
'unicorn/consistent-function-scoping': 'off',
5853
'unicorn/import-style': 'off',
59-
'unicorn/no-array-callback-reference': 'off',
6054
'unicorn/no-await-expression-member': 'off',
6155
'unicorn/no-object-as-default-parameter': 'off',
62-
'unicorn/no-useless-switch-case': 'off',
6356
'unicorn/numeric-separators-style': 'off',
6457
'unicorn/prefer-export-from': 'off',
6558
'unicorn/prefer-string-slice': 'off',
6659
'unicorn/prevent-abbreviations': 'off',
6760
'unicorn/require-array-join-separator': 'off',
68-
'unicorn/switch-case-braces': 'off',
6961

7062
'@typescript-eslint/array-type': [
7163
'error',
7264
{ default: 'array-simple', readonly: 'generic' },
7365
],
66+
'@typescript-eslint/consistent-type-exports': 'error',
7467
'@typescript-eslint/consistent-type-imports': 'error',
7568
'@typescript-eslint/explicit-module-boundary-types': 'error',
7669
'@typescript-eslint/naming-convention': [
@@ -102,6 +95,16 @@ module.exports = defineConfig({
10295
{ blankLine: 'always', prev: 'block-like', next: '*' },
10396
],
10497
'@typescript-eslint/prefer-regexp-exec': 'error',
98+
'@typescript-eslint/restrict-plus-operands': [
99+
'error',
100+
{
101+
allowAny: false,
102+
allowBoolean: false,
103+
allowNullish: false,
104+
allowNumberAndString: true,
105+
allowRegExp: false,
106+
},
107+
],
105108
'@typescript-eslint/restrict-template-expressions': [
106109
'error',
107110
{ allowNumber: true, allowBoolean: true },

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
* -crlf
1+
* text eol=lf
2+
*.png binary

.github/CODEOWNERS

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
# These owners will be the default owners for everything in the repo.
22
# Unless a later match takes precedence, @faker-js/maintainers will
33
# be requested for review when someone opens a pull request.
4-
5-
* @faker-js/maintainers
6-
7-
# ================================================
8-
# Docs owners ...
9-
# ================================================
10-
11-
/docs/ @faker-js/maintainers-docs @faker-js/maintainers
12-
netlify.toml @faker-js/maintainers-docs @faker-js/maintainers
13-
README.md @faker-js/maintainers-docs @faker-js/maintainers
14-
CONTRIBUTING.md @faker-js/maintainers-docs @faker-js/maintainers
15-
16-
# ================================================
17-
# CODEOWNERS owners ...
18-
# ================================================
19-
20-
/.github/CODEOWNERS @faker-js/maintainers
4+
* @faker-js/maintainers

.github/renovate.json5

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:base",
4+
"config:best-practices",
55
"schedule:earlyMondays",
66
"group:allNonMajor",
7-
":prHourlyLimitNone",
8-
"helpers:pinGitHubActionDigests"
7+
":prHourlyLimitNone"
98
],
10-
"labels": ["c: dependencies"],
9+
"labels": ["c: dependencies", "p: 1-normal"],
10+
"lockFileMaintenance": {
11+
"enabled": true
12+
},
13+
"milestone": 15,
1114
"reviewersFromCodeOwners": true,
12-
"rangeStrategy": "bump",
15+
"rangeStrategy": "pin",
1316
"packageRules": [
1417
{
1518
"groupName": "devDependencies",
16-
"matchDepTypes": ["devDependencies"],
17-
"rangeStrategy": "bump"
19+
"matchDepTypes": ["devDependencies"]
1820
},
1921
{
2022
"groupName": "dependencies",
@@ -32,12 +34,16 @@
3234
"rangeStrategy": "replace"
3335
},
3436
{
35-
"groupName": "typescript-eslint",
36-
"matchPackagePrefixes": ["@typescript-eslint/"]
37+
"groupName": "eslint",
38+
"matchPackagePrefixes": [
39+
"@typescript-eslint/",
40+
"@eslint-types/",
41+
"eslint"
42+
]
3743
},
3844
{
3945
"groupName": "vitest",
40-
"matchPackageNames": ["@vitest/coverage-v8", "@vitest/ui", "vitest"]
46+
"matchPackagePrefixes": ["@vitest/", "vitest"]
4147
},
4248
{
4349
"groupName": "prettier",
@@ -49,16 +55,11 @@
4955
},
5056
{
5157
"groupName": "doc-dependencies",
52-
"matchPackageNames": [
53-
"@algolia/client-search",
54-
"typedoc",
55-
"typedoc-plugin-missing-exports",
56-
"vitepress"
57-
]
58+
"matchPackageNames": ["@algolia/client-search", "ts-morph", "vitepress"]
5859
}
5960
],
6061
"vulnerabilityAlerts": {
61-
"labels": ["c: security"],
62+
"labels": ["c: security", "p: 2-high"],
6263
"assignees": ["team:maintainers"]
6364
}
6465
}

.github/workflows/ci.yml

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,24 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [ubuntu-latest]
18-
node_version: [14, 16, 18, 20]
19-
include:
20-
- os: macos-latest
21-
node_version: 16
22-
- os: macos-latest
23-
node_version: 18
24-
- os: macos-latest
25-
node_version: 20
26-
- os: windows-latest
27-
node_version: 16
28-
- os: windows-latest
29-
node_version: 18
30-
- os: windows-latest
31-
node_version: 20
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
node_version: [18, 20]
3219
fail-fast: false
3320
timeout-minutes: 10
3421

3522
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
3623
steps:
3724
- name: Checkout
38-
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
25+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3926
with:
4027
# Required for docs/versions tests
4128
fetch-depth: 0
4229

43-
- name: Install pnpm (node 14, pnpm 7)
44-
if: matrix.node_version == 14
45-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
46-
with:
47-
version: 7
48-
4930
- name: Install pnpm
50-
if: matrix.node_version != 14
51-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
31+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
5232

5333
- name: Set node version to ${{ matrix.node_version }}
54-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
34+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
5535
with:
5636
node-version: ${{ matrix.node_version }}
5737
cache: 'pnpm'
@@ -90,16 +70,16 @@ jobs:
9070
run: date
9171

9272
- name: Checkout
93-
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
73+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
9474
with:
9575
# Required for docs/versions tests
9676
fetch-depth: 0
9777

9878
- name: Install pnpm
99-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
79+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
10080

10181
- name: Set node version to ${{ matrix.node_version }}
102-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
82+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
10383
with:
10484
node-version: ${{ matrix.node_version }}
10585
cache: 'pnpm'
@@ -118,16 +98,16 @@ jobs:
11898
e2e-test:
11999
runs-on: ubuntu-latest
120100
container:
121-
image: cypress/browsers:node-20.6.1-chrome-116.0.5845.187-1-ff-117.0-edge-116.0.1938.76-1
101+
image: cypress/browsers:node-20.6.1-chrome-116.0.5845.187-1-ff-117.0-edge-116.0.1938.76-1@sha256:cd909915e1a0aa24dbd3eaf95feb2a7be6cf9961fa425ffa06cd5a44d211451c
122102
options: --user 1001
123103
timeout-minutes: 10
124104
name: 'E2E Doc Test: node-20, ubuntu-latest'
125105
steps:
126106
- name: Checkout
127-
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
107+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
128108

129109
- name: Install pnpm
130-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
110+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
131111

132112
- name: Install deps
133113
run: pnpm install
@@ -145,15 +125,15 @@ jobs:
145125
name: 'Lint: node-20, ubuntu-latest'
146126
steps:
147127
- name: Checkout
148-
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
128+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
149129
with:
150130
fetch-depth: 0
151131

152132
- name: Install pnpm
153-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
133+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
154134

155135
- name: Set node version to 20
156-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
136+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
157137
with:
158138
node-version: 20
159139
cache: 'pnpm'
@@ -175,15 +155,15 @@ jobs:
175155
name: 'TS-Check: node-20, ubuntu-latest'
176156
steps:
177157
- name: Checkout
178-
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
158+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
179159
with:
180160
fetch-depth: 0
181161

182162
- name: Install pnpm
183-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
163+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
184164

185165
- name: Set node version to 20
186-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
166+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
187167
with:
188168
node-version: 20
189169
cache: 'pnpm'
@@ -193,6 +173,9 @@ jobs:
193173
env:
194174
CYPRESS_INSTALL_BINARY: 0
195175

176+
- name: Build types
177+
run: pnpm run build:types
178+
196179
- name: Check scripts
197180
run: pnpm run ts-check
198181

@@ -202,15 +185,15 @@ jobs:
202185
name: 'Codecov: node-20, ubuntu-latest'
203186
steps:
204187
- name: Checkout
205-
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
188+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
206189
with:
207190
fetch-depth: 0
208191

209192
- name: Install pnpm
210-
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
193+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
211194

212195
- name: Set node version to 20
213-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
196+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
214197
with:
215198
node-version: 20
216199
cache: 'pnpm'
@@ -227,7 +210,7 @@ jobs:
227210
run: pnpm vitest run --coverage
228211

229212
- name: Upload coverage to Codecov
230-
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1
213+
uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 # v4.1.1
231214
with:
232215
token: ${{ secrets.CODECOV_TOKEN }}
233216
fail_ci_if_error: true

.github/workflows/commentCodeGeneration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import type { context as ctx, GitHub } from '@actions/github/lib/utils';
1010
* @param context An object containing the context of the workflow run
1111
* @param isSuccess A boolean indicating whether the workflow was successful
1212
*/
13-
module.exports = async (
13+
export async function script(
1414
github: InstanceType<typeof GitHub>,
1515
context: typeof ctx,
1616
isSuccess: boolean
17-
) => {
17+
): Promise<void> {
1818
const { data: comments } = await github.rest.issues.listComments({
1919
owner: context.repo.owner,
2020
repo: context.repo.repo,
@@ -45,4 +45,4 @@ module.exports = async (
4545
body,
4646
});
4747
}
48-
};
48+
}

0 commit comments

Comments
 (0)