toonvanstrijp / nestjs-i18n

The i18n module for nestjs.
https://nestjs-i18n.com
Other
656 stars 113 forks source link

Bug with generated types, bad property "filter" #643

Open gomez-git opened 4 months ago

gomez-git commented 4 months ago

Describe the bug

Have error when use it in my code.

image

image

Generated I18nTranslations file:

/* DO NOT EDIT, file generated by nestjs-i18n */

/* eslint-disable */
/* prettier-ignore */
import { Path } from "nestjs-i18n";
/* prettier-ignore */
export type I18nTranslations = {
    "errors": {
        "accessToken": {
            "isIncorrect": string;
        };
        "auth": {
            "badHeader": string;
            "headerIsMissing": string;
            "incorrectLogin": string;
            "": string;
        };
        "email": {
            "incorrect": string;
        };
        "files": {
            "image": string;
            "imageOrGif": string;
        };
        "platform": {
            "filterGroup": {
                "deleteDefaultGroup": string;
                "duplicateName": string;
                "notFound": string;
                "updateDefaultGroup": string;
            };
            "filter": {
                "duplicateName": string;
                "notFound": string;
            };
            "filterItems": {
                "notFound": string;
            };
            "notEnoughRightsToDeactivate": string;
            "notFound": string;
            "review": {
                "notFound": string;
            };
        };
        "refreshToken": {
            "isEmpty": string;
            "isIncorrect": string;
        };
        "role": {
            "notFound": string;
        };
        "solution": {
            "duplicateName": string;
            "event": {
                "duplicateText": string;
                "notFound": string;
            };
            "filter": {
                "duplicateName": string;
                "notFound": string;
            };
            "filterItems": {
                "notFound": string;
            };
            "notEnoughRightsToDeactivate": string;
            "notFound": string;
            "photo": {
                "duplicateFiles": string;
                "missingDescriptions": string;
                "maxCount": string;
                "notFound": string;
            };
            "review": {
                "notFound": string;
            };
            "task": {
                "notFound": string;
            };
            "video": {
                "notFound": string;
            };
        };
        "user": {
            "blockYourself": string;
            "blocked": string;
            "deleteYourself": string;
            "notFound": string;
            "unblockYourself": string;
            "updateRoleYourself": string;
        };
        "users": {
            "notFound": string;
        };
    };
};
/* prettier-ignore */
export type I18nPath = Path<I18nTranslations>;

Reproduction

Generate file src/i18n/(en|ru)/errors.json with 3 depth

System Info

System:
    OS: macOS 13.6.7
    CPU: (8) arm64 Apple M1 Pro
    Memory: 54.11 MB / 16.00 GB
    Shell: 5.2.26 - /opt/homebrew/bin/bash
  Binaries:
    Node: 20.15.0 - ~/.local/state/fnm_multishells/1159_1720288567205/bin/node
    npm: 10.7.0 - ~/.local/state/fnm_multishells/1159_1720288567205/bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5

Used Package Manager

npm

Validations

gomez-git commented 4 months ago
├── @faker-js/faker@8.4.1
├── @nestjs/cli@10.4.2
├── @nestjs/common@10.3.10
├── @nestjs/config@3.2.3
├── @nestjs/core@10.3.10
├── @nestjs/jwt@10.2.0
├── @nestjs/platform-express@10.3.10
├── @nestjs/schedule@4.1.0
├── @nestjs/schematics@10.1.2
├── @nestjs/sequelize@10.0.1
├── @nestjs/serve-static@4.0.2
├── @nestjs/swagger@7.4.0
├── @nestjs/testing@10.3.10
├── @ntegral/nestjs-sendgrid@1.0.0
├── @sendgrid/mail@8.1.3
├── @swc/cli@0.3.14
├── @swc/core@1.6.13
├── @swc/jest@0.2.36
├── @types/bcryptjs@2.4.6
├── @types/cookie-parser@1.4.7
├── @types/express@4.17.21
├── @types/fs-extra@11.0.4
├── @types/multer@1.4.11
├── @types/node@20.14.10
├── @types/sequelize@4.28.20
├── @typescript-eslint/eslint-plugin@7.15.0
├── @typescript-eslint/parser@7.15.0
├── bcryptjs@2.4.3
├── class-transformer@0.5.1
├── class-validator@0.14.1
├── cookie-parser@1.4.6
├── cross-env@7.0.3
├── dotenv@16.4.5
├── eslint-config-prettier@9.1.0
├── eslint-plugin-prettier@5.1.3
├── eslint@8.57.0
├── fs-extra@11.2.0
├── husky@9.0.11
├── jest@29.7.0
├── lodash@4.17.21
├── nestjs-i18n@10.4.5
├── pg-hstore@2.3.4
├── pg@8.12.0
├── prettier-eslint@16.3.0
├── prettier@3.3.2
├── reflect-metadata@0.2.2
├── rimraf@5.0.8
├── rxjs@7.8.1
├── sequelize-cli@6.6.2
├── sequelize-typescript@2.1.6
├── sequelize@6.37.3
├── source-map-support@0.5.21
├── tsconfig-paths@4.2.0
└── typescript@5.5.3
gomez-git commented 4 months ago
{
  "filter": "hello"
}