Skip to content

Commit 28e419a

Browse files
committed
Merge branch 'next' into fix/finance/maskedNumber-defaults
2 parents ac10f9a + a83db8b commit 28e419a

45 files changed

Lines changed: 72 additions & 59 deletions

Some content is hidden

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

.eslintrc.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ module.exports = defineConfig({
4141
'unicorn/prefer-at': 'off',
4242
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14.
4343
'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',
4446

4547
// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
4648
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
4749
'unicorn/better-regex': 'off',
4850
'unicorn/consistent-function-scoping': 'off',
49-
'unicorn/filename-case': 'off',
5051
'unicorn/import-style': 'off',
5152
'unicorn/no-array-callback-reference': 'off',
5253
'unicorn/no-array-reduce': 'off',
@@ -60,7 +61,6 @@ module.exports = defineConfig({
6061
'unicorn/prefer-module': 'off',
6162
'unicorn/prefer-negative-index': 'off',
6263
'unicorn/prefer-string-slice': 'off',
63-
'unicorn/prefer-top-level-await': 'off',
6464
'unicorn/prevent-abbreviations': 'off',
6565
'unicorn/require-array-join-separator': 'off',
6666
'unicorn/switch-case-braces': 'off',
@@ -139,8 +139,26 @@ module.exports = defineConfig({
139139
},
140140
},
141141
{
142-
files: ['src/locales/**/*.ts'],
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'],
143149
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+
],
144162
'unicorn/text-encoding-identifier-case': 'off',
145163
},
146164
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { DeclarationReflection, ProjectReflection } from 'typedoc';
22
import { ReflectionKind } from 'typedoc';
33
import type { Method } from '../../docs/.vitepress/components/api-docs/method';
4-
import { writeApiDocsModule } from './apiDocsWriter';
5-
import { analyzeModule, processModuleMethods } from './moduleMethods';
4+
import { analyzeModule, processModuleMethods } from './module-methods';
65
import { analyzeSignature } from './signature';
76
import { extractModuleFieldName, selectApiSignature } from './typedoc';
87
import type { ModuleSummary } from './utils';
8+
import { writeApiDocsModule } from './writer';
99

1010
export async function processFakerClasses(
1111
project: ProjectReflection
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { DeclarationReflection, ProjectReflection } from 'typedoc';
22
import { ReflectionKind } from 'typedoc';
33
import type { Method } from '../../docs/.vitepress/components/api-docs/method';
4-
import { writeApiDocsModule } from './apiDocsWriter';
5-
import { processMethods } from './moduleMethods';
4+
import { processMethods } from './module-methods';
65
import { selectApiSignature } from './typedoc';
76
import type { ModuleSummary } from './utils';
7+
import { writeApiDocsModule } from './writer';
88

99
export async function processFakerUtilities(
1010
project: ProjectReflection

scripts/apidoc/generate.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { resolve } from 'node:path';
2+
import { processFakerClasses, processFakerRandomizer } from './faker-class';
3+
import { processFakerUtilities } from './faker-utilities';
4+
import { processModules } from './module-methods';
5+
import { loadProject } from './typedoc';
6+
import { pathOutputDir } from './utils';
27
import {
38
writeApiDiffIndex,
49
writeApiPagesIndex,
510
writeApiSearchIndex,
611
writeSourceBaseUrl,
7-
} from './apiDocsWriter';
8-
import { processFakerClasses, processFakerRandomizer } from './fakerClass';
9-
import { processFakerUtilities } from './fakerUtilities';
10-
import { processModules } from './moduleMethods';
11-
import { loadProject } from './typedoc';
12-
import { pathOutputDir } from './utils';
12+
} from './writer';
1313

1414
const pathOutputJson = resolve(pathOutputDir, 'typedoc.json');
1515

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type {
44
SignatureReflection,
55
} from 'typedoc';
66
import type { Method } from '../../docs/.vitepress/components/api-docs/method';
7-
import { writeApiDocsModule } from './apiDocsWriter';
87
import { codeToHtml } from './markdown';
98
import { analyzeSignature } from './signature';
109
import {
@@ -18,6 +17,7 @@ import {
1817
} from './typedoc';
1918
import type { ModuleSummary } from './utils';
2019
import { adjustUrls } from './utils';
20+
import { writeApiDocsModule } from './writer';
2121

2222
/**
2323
* Analyzes and writes the documentation for modules and their methods such as `faker.animal.cat()`.

scripts/apidoc/typedoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
DefaultParameterAwareSerializer,
2020
parameterDefaultReader,
2121
patchProjectParameterDefaults,
22-
} from './parameterDefaults';
22+
} from './parameter-defaults';
2323
import { mapByName } from './utils';
2424

2525
type CommentHolder = Pick<Reflection, 'comment'>;

0 commit comments

Comments
 (0)