Skip to content

Commit

Permalink
Merge branch 'next' into renovate/mcr.microsoft.com-devcontainers-typ…
Browse files Browse the repository at this point in the history
…escript-node-22.x
  • Loading branch information
xDivisionByZerox authored May 27, 2024
2 parents 0a00cf3 + 29c5a18 commit 3193a09
Show file tree
Hide file tree
Showing 46 changed files with 120 additions and 102 deletions.
16 changes: 6 additions & 10 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ module.exports = defineConfig({
trailingUnderscore: 'forbid',
},
],
'@typescript-eslint/no-confusing-void-expression': [
'error',
{
ignoreArrowShorthand: true,
},
],
'@typescript-eslint/no-inferrable-types': [
'error',
{ ignoreParameters: true },
Expand Down Expand Up @@ -114,10 +120,6 @@ module.exports = defineConfig({
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/unified-signatures': 'off', // incompatible with our api docs generation

// TODO @ST-DDT 2023-10-10: The following rules currently conflict with our code.
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
'@typescript-eslint/no-confusing-void-expression': 'off',

'jsdoc/require-jsdoc': 'off', // Enabled only for src/**/*.ts
'jsdoc/require-returns': 'off',
'jsdoc/sort-tags': [
Expand Down Expand Up @@ -164,12 +166,6 @@ module.exports = defineConfig({
'error',
{
case: 'snakeCase',
// TODO @ST-DDT 2023-10-21: rename the definitions in v9
ignore: [
/chemicalElement\.ts$/,
/directoryPaths\.ts$/,
/mimeTypes\.ts$/,
],
},
],
'unicorn/text-encoding-identifier-case': 'off',
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node_version: [18, 20]
node_version: [18, 20, 22]
fail-fast: false
timeout-minutes: 10

Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
name: 'Lint: node-20, ubuntu-latest'
name: 'Lint: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
Expand All @@ -132,10 +132,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 20
- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: Install deps
Expand All @@ -152,7 +152,7 @@ jobs:
ts-check:
runs-on: ubuntu-latest
timeout-minutes: 10
name: 'TS-Check: node-20, ubuntu-latest'
name: 'TS-Check: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
Expand All @@ -162,10 +162,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 20
- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: Install deps
Expand All @@ -182,7 +182,7 @@ jobs:
codecov:
runs-on: ubuntu-latest
timeout-minutes: 10
name: 'Codecov: node-20, ubuntu-latest'
name: 'Codecov: node-22, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
Expand All @@ -192,10 +192,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 20
- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: Install deps
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
check-code-generation:
runs-on: ubuntu-latest
timeout-minutes: 10
name: 'Check Code Generation: node-20, ubuntu-latest'
name: 'Check Code Generation: node-22, ubuntu-latest'
permissions:
pull-requests: write
steps:
Expand All @@ -22,10 +22,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set node version to 20
- name: Set node version to 22
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: Install deps
Expand Down
22 changes: 22 additions & 0 deletions docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,28 @@ Renamed deprecated locale aliases `cz`, `en_IND`, `ge` and removed `global`.
| `import { faker } from '@faker-js/faker/locale/ge'` | `import { faker } from '@faker-js/faker/locale/ka_GE'` |
| `import { faker } from '@faker-js/faker/locale/global'` | `import { faker } from '@faker-js/faker/locale/base'` |

### Renamed Locale Definitions

The following locale definitions have been renamed

| old | replacement |
| ------------------------------------------- | -------------------------------------------- |
| `faker.definitions.science.chemicalElement` | `faker.definitions.science.chemical_element` |
| `faker.definitions.system.directoryPaths` | `faker.definitions.system.directory_paths` |
| `faker.definitions.system.mimeTypes` | `faker.definitions.system.mime_types` |

With that now all our locale data use the following naming scheme:

```txt
faker.definitions.category_name.entry_name
```

Please keep in mind that property keys of complex objects remain in camel-case.

```txt
faker.definitions.science.chemical_element.atomicNumber
```

### Type Aliases

Removed deprecated type aliases
Expand Down
1 change: 0 additions & 1 deletion scripts/generate-locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) {

const legacyDefinitions = ['app', 'cell_phone', 'team'];
const definitionsToSkip = [
'finance',
'internet',
'location',
'lorem',
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/science.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export type ScienceDefinition = LocaleEntry<{
/**
* Some periodic table element information.
*/
chemicalElement: ReadonlyArray<ChemicalElement>;
chemical_element: ReadonlyArray<ChemicalElement>;
}>;
4 changes: 2 additions & 2 deletions src/definitions/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export type SystemDefinition = LocaleEntry<{
/**
* Returns some common file paths.
*/
directoryPaths: string[];
directory_paths: string[];

/**
* The mime type definitions with some additional information.
*/
mimeTypes: { [mimeType: string]: SystemMimeTypeEntryDefinition };
mime_types: { [mimeType: string]: SystemMimeTypeEntryDefinition };
}>;

/**
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/locales/base/system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { SystemDefinition } from '../../..';
import directoryPaths from './directoryPaths';
import mimeTypes from './mimeTypes';
import directory_paths from './directory_paths';
import mime_types from './mime_types';

const system: SystemDefinition = {
directoryPaths,
mimeTypes,
directory_paths,
mime_types,
};

export default system;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/el/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['Καταθετικός', 'Μισθοδοσίας', 'Δανειακός'];
export default ['Δανειακός', 'Καταθετικός', 'Μισθοδοσίας'];
6 changes: 3 additions & 3 deletions src/locales/el/finance/credit_card/discover.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default [
'/6011-####-####-###L/',
'/65##-####-####-###L/',
'/64[4-9]#-####-####-###L/',
'/6011-62##-####-####-###L/',
'/65##-62##-####-####-###L/',
'/64[4-9]#-####-####-###L/',
'/64[4-9]#-62##-####-####-###L/',
'/65##-####-####-###L/',
'/65##-62##-####-####-###L/',
];
2 changes: 1 addition & 1 deletion src/locales/el/finance/credit_card/mastercard.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['5[1-5]##-####-####-###L', '2[221-720]-####-####-###L'];
export default ['2[221-720]-####-####-###L', '5[1-5]##-####-####-###L'];
2 changes: 1 addition & 1 deletion src/locales/el/finance/transaction_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['κατάθεση', 'ανάληψη', 'πληρωμή', 'τιμολόγιο'];
export default ['ανάληψη', 'κατάθεση', 'πληρωμή', 'τιμολόγιο'];
10 changes: 5 additions & 5 deletions src/locales/en/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default [
'Auto Loan',
'Checking',
'Savings',
'Money Market',
'Investment',
'Home Loan',
'Credit Card',
'Auto Loan',
'Home Loan',
'Investment',
'Money Market',
'Personal Loan',
'Savings',
];
6 changes: 3 additions & 3 deletions src/locales/en/finance/credit_card/discover.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default [
'6011-####-####-###L',
'65##-####-####-###L',
'64[4-9]#-####-####-###L',
'6011-62##-####-####-###L',
'65##-62##-####-####-###L',
'64[4-9]#-####-####-###L',
'64[4-9]#-62##-####-####-###L',
'65##-####-####-###L',
'65##-62##-####-####-###L',
];
2 changes: 1 addition & 1 deletion src/locales/en/finance/credit_card/mastercard.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['5[1-5]##-####-####-###L', '2[221-720]-####-####-###L'];
export default ['2[221-720]-####-####-###L', '5[1-5]##-####-####-###L'];
2 changes: 1 addition & 1 deletion src/locales/en/finance/transaction_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['deposit', 'withdrawal', 'payment', 'invoice'];
export default ['deposit', 'invoice', 'payment', 'withdrawal'];
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/en/science/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { ScienceDefinition } from '../../..';
import chemicalElement from './chemicalElement';
import chemical_element from './chemical_element';
import unit from './unit';

const science: ScienceDefinition = {
chemicalElement,
chemical_element,
unit,
};

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/eo/science/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { ScienceDefinition } from '../../..';
import chemicalElement from './chemicalElement';
import chemical_element from './chemical_element';
import unit from './unit';

const science: ScienceDefinition = {
chemicalElement,
chemical_element,
unit,
};

Expand Down
6 changes: 3 additions & 3 deletions src/locales/fa/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default [
'پس انداز',
'سرمایه گذاری',
'وام مسکن',
'کارت اعتباری',
'وام خودرو',
'وام شخصی',
'وام مسکن',
'پس انداز',
'کارت اعتباری',
];
2 changes: 1 addition & 1 deletion src/locales/fa/finance/credit_card/mastercard.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['5[1-5]##-####-####-###L', '2[221-720]-####-####-###L'];
export default ['2[221-720]-####-####-###L', '5[1-5]##-####-####-###L'];
2 changes: 1 addition & 1 deletion src/locales/fa/finance/transaction_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['سپرده', 'برداشت از حساب', 'پرداخت', 'صورتحساب'];
export default ['برداشت از حساب', 'سپرده', 'صورتحساب', 'پرداخت'];
4 changes: 2 additions & 2 deletions src/locales/fr/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export default [
'Carte de crédit',
'Chèque',
'Epargne',
'Marché monétaire',
'Investissement',
'Marché monétaire',
'Prêt immobilier',
'Carte de crédit',
'Prêt personnel',
];
2 changes: 1 addition & 1 deletion src/locales/fr/finance/transaction_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['dépôt', 'retrait', 'paiement', 'facture'];
export default ['dépôt', 'facture', 'paiement', 'retrait'];
8 changes: 4 additions & 4 deletions src/locales/hu/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default [
'Befektetés',
'Fizetési',
'Gépjármű kölcsön',
'Hitelkártya',
'Lakáshitel',
'Megtakaritás',
'Money Market',
'Befektetés',
'Lakáshitel',
'Hitelkártya',
'Gépjármű kölcsön',
'Személyi kölcsön',
];
2 changes: 1 addition & 1 deletion src/locales/hu/finance/transaction_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['pénzbefizetés', 'pénzfelvétel', 'fizetés', 'számlázás'];
export default ['fizetés', 'pénzbefizetés', 'pénzfelvétel', 'számlázás'];
4 changes: 2 additions & 2 deletions src/locales/nb_NO/science/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { ScienceDefinition } from '../../..';
import chemicalElement from './chemicalElement';
import chemical_element from './chemical_element';
import unit from './unit';

const science: ScienceDefinition = {
chemicalElement,
chemical_element,
unit,
};

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/pl/science/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { ScienceDefinition } from '../../..';
import chemicalElement from './chemicalElement';
import chemical_element from './chemical_element';
import unit from './unit';

const science: ScienceDefinition = {
chemicalElement,
chemical_element,
unit,
};

Expand Down
2 changes: 1 addition & 1 deletion src/locales/ur/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['Savings', 'Current'];
export default ['Current', 'Savings'];
2 changes: 1 addition & 1 deletion src/locales/ur/finance/transaction_type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['deposit', 'withdrawal', 'payment', 'invoice'];
export default ['deposit', 'invoice', 'payment', 'withdrawal'];
10 changes: 5 additions & 5 deletions src/locales/zh_CN/finance/account_type.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default [
'支票',
'个人贷款',
'信用卡',
'储蓄',
'货币市场',
'投资',
'房屋贷款',
'信用卡',
'投资',
'支票',
'汽车贷款',
'个人贷款',
'货币市场',
];
2 changes: 1 addition & 1 deletion src/locales/zh_CN/finance/credit_card/mastercard.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ['5[1-5]##-####-####-###L', '2[221-720]-####-####-###L'];
export default ['2[221-720]-####-####-###L', '5[1-5]##-####-####-###L'];
Loading

0 comments on commit 3193a09

Please sign in to comment.