SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js
https://adminjs.co
MIT License
8.17k stars 660 forks source link

Cannot build nestjs because of react props #1113

Closed nemo-market-dev closed 2 years ago

nemo-market-dev commented 2 years ago

When I do "tsc -p tsconfig.build.json", I got some errors. Almost errors are about properties. Can I ask some help?

  yarn run build:prod
  yarn run v1.22.10
  $ rimraf dist
  $ tsc -p tsconfig.build.json && cp package.json dist/ && cp -r .ebextensions dist/.ebextensions/ && cp -r .platform/ dist/.platform/
  node_modules/adminjs/src/backend/bundler/generate-user-component-entry.ts:31:26 - error TS2304: Cannot find name 'UserComponentsMap'.

  31       (UserComponents as UserComponentsMap)[componentId],
                              ~~~~~~~~~~~~~~~~~

  node_modules/adminjs/src/backend/decorators/resource/utils/decorate-actions.ts:41:27 - error TS2339: Property 'label' does not exist on type 'Partial<Action<ActionResponse>>'.

  41       label: actions[key].label || key,
                               ~~~~~

  node_modules/adminjs/src/backend/decorators/resource/utils/decorate-actions.ts:42:7 - error TS2322: Type 'string[] | ActionType' is not assignable to type 'ActionType'.
    Type 'string[]' is not assignable to type 'ActionType'.

  42       actionType: actions[key].actionType || ['resource'],
           ~~~~~~~~~~

    node_modules/adminjs/src/backend/actions/action.interface.ts:416:3
      416   actionType: ActionType;
            ~~~~~~~~~~
      The expected type comes from property 'actionType' which is declared here on type 'Action<ActionResponse>'

  node_modules/adminjs/src/backend/decorators/resource/utils/get-navigation.ts:52:7 - error TS2322: Type 'string | { name?: string; icon?: string; }' is not assignable to type 'string'.
    Type '{ name?: string; icon?: string; }' is not assignable to type 'string'.

  52       name: navigationOption || database.databaseName(),
           ~~~~

    node_modules/adminjs/src/frontend/interfaces/resource-json.interface.ts:30:5
      30     name: string | null;
             ~~~~
      The expected type comes from property 'name' which is declared here on type '{ name: string; icon: string; show: boolean; }'

  node_modules/adminjs/src/backend/utils/view-helpers/view-helpers.ts:79:5 - error TS2322: Type 'Paths | { rootPath: string; }' is not assignable to type 'Paths'.
    Type '{ rootPath: string; }' is missing the following properties from type 'Paths': logoutPath, loginPath

  79     opts = opts || {
         ~~~~

  node_modules/adminjs/src/frontend/components/app/action-button/action-button.tsx:42:11 - error TS2339: Property 'children' does not exist on type 'ActionButtonProps'.

  42   const { children, action, actionPerformed, resourceId, recordId, recordIds } = props
               ~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:31:10 - error TS2739: Type '{ variant: string; }' is missing the following properties from type 'Pick<any, "variant" | "children" | "height" | "width">': children, height, width

  31         <Illustration variant="Rocket" />
              ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:40:10 - error TS2739: Type '{ variant: string; }' is missing the following properties from type 'Pick<any, "variant" | "children" | "height" | "width">': children, height, width

  40         <Illustration variant="Moon" />
              ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:135:18 - error TS2741: Property 'children' is missing in type '{ variant: "Planet" | "DocumentCheck" | "DocumentSearch" | "FlagInCog" | "Folders" | "Astronaut" | "Rocket" | "Moon" | "SoftwareBrothersLogo" | "FileSearch" | "Launch" | "AdminJSLogo" | "GithubLogo" | "SlackLogo"; width: number; height: number; }' but required in type 'Pick<any, "variant" | "children" | "height" | "width">'.

  135                 <Illustration
                       ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:148:34 - error TS2739: Type '{ variant: string; }' is missing the following properties from type 'Pick<any, "variant" | "children" | "height" | "width">': children, height, width

  148             <Box flexShrink={0}><Illustration variant="SlackLogo" /></Box>
                                       ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:157:34 - error TS2739: Type '{ variant: string; }' is missing the following properties from type 'Pick<any, "variant" | "children" | "height" | "width">': children, height, width

  157             <Box flexShrink={0}><Illustration variant="GithubLogo" /></Box>
                                       ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:166:14 - error TS2739: Type '{ variant: string; }' is missing the following properties from type 'Pick<any, "variant" | "children" | "height" | "width">': children, height, width

  166             <Illustration variant="SoftwareBrothersLogo" />
                   ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/records-table/no-records.tsx:25:10 - error TS2322: Type '{ children: Element; action: ActionJSON; resourceId: string; }' is not assignable to type 'IntrinsicAttributes & ActionButtonProps'.
    Property 'children' does not exist on type 'IntrinsicAttributes & ActionButtonProps'.

  25         <ActionButton action={canCreate} resourceId={resource.id}>
              ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/sidebar/sidebar.tsx:6:33 - error TS2307: Cannot find module 'src/adminjs-options.interface' or its corresponding type declarations.

  6 import { BrandingOptions } from 'src/adminjs-options.interface'
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/sidebar/sidebar.tsx:7:40 - error TS2307: Cannot find module 'src/frontend/interfaces' or its corresponding type declarations.

  7 import { ResourceJSON, PageJSON } from 'src/frontend/interfaces'
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/app/top-bar.tsx:45:16 - error TS2322: Type 'CurrentAdmin | Paths | VersionProps' is not assignable to type 'VersionProps'.
    Type 'CurrentAdmin' has no properties in common with type 'VersionProps'.

  45       <Version versions={versions} />
                    ~~~~~~~~

    node_modules/adminjs/src/frontend/components/app/version.tsx:9:3
      9   versions: VersionProps;
          ~~~~~~~~
      The expected type comes from property 'versions' which is declared here on type 'IntrinsicAttributes & Props'

  node_modules/adminjs/src/frontend/components/app/top-bar.tsx:46:27 - error TS2339: Property 'email' does not exist on type 'CurrentAdmin | Paths | VersionProps'.
    Property 'email' does not exist on type 'Paths'.

  46       {session && session.email ? <LoggedIn session={session} paths={paths} /> : ''}
                               ~~~~~

  node_modules/adminjs/src/frontend/components/app/top-bar.tsx:46:45 - error TS2322: Type 'CurrentAdmin | Paths | VersionProps' is not assignable to type 'CurrentAdmin'.
    Property 'email' is missing in type 'Paths' but required in type 'CurrentAdmin'.

  46       {session && session.email ? <LoggedIn session={session} paths={paths} /> : ''}
                                                 ~~~~~~~

    node_modules/adminjs/src/current-admin.interface.ts:17:3
      17   email: string;
           ~~~~~
      'email' is declared here.
    node_modules/adminjs/src/frontend/components/app/logged-in.tsx:9:3
      9   session: CurrentAdmin;
          ~~~~~~~
      The expected type comes from property 'session' which is declared here on type 'IntrinsicAttributes & LoggedInProps & { OriginalComponent?: ComponentType<LoggedInProps>; }'

  node_modules/adminjs/src/frontend/components/app/top-bar.tsx:46:63 - error TS2322: Type 'CurrentAdmin | Paths | VersionProps' is not assignable to type '{ logoutPath: string; }'.
    Property 'logoutPath' is missing in type 'CurrentAdmin' but required in type '{ logoutPath: string; }'.

  46       {session && session.email ? <LoggedIn session={session} paths={paths} /> : ''}
                                                                   ~~~~~

    node_modules/adminjs/src/frontend/components/app/logged-in.tsx:11:5
      11     logoutPath: string;
             ~~~~~~~~~~
      'logoutPath' is declared here.
    node_modules/adminjs/src/frontend/components/app/logged-in.tsx:10:3
      10   paths: {
           ~~~~~
      The expected type comes from property 'paths' which is declared here on type 'IntrinsicAttributes & LoggedInProps & { OriginalComponent?: ComponentType<LoggedInProps>; }'

  node_modules/adminjs/src/frontend/components/login/index.tsx:73:18 - error TS2741: Property 'children' is missing in type '{ variant: string; width: number; height: number; }' but required in type 'Pick<any, "variant" | "children" | "height" | "width">'.

  73                 <Illustration variant="Planet" width={82} height={91} />
                      ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/login/index.tsx:76:18 - error TS2741: Property 'children' is missing in type '{ variant: string; width: number; height: number; }' but required in type 'Pick<any, "variant" | "children" | "height" | "width">'.

  76                 <Illustration variant="Astronaut" width={82} height={91} />
                      ~~~~~~~~~~~~

  node_modules/adminjs/src/frontend/components/login/index.tsx:79:18 - error TS2741: Property 'children' is missing in type '{ variant: string; width: number; height: number; }' but required in type 'Pick<any, "variant" | "children" | "height" | "width">'.

  79                 <Illustration variant="FlagInCog" width={82} height={91} />
                      ~~~~~~~~~~~~

  Found 22 errors in 10 files.

  Errors  Files
       1  node_modules/adminjs/src/backend/bundler/generate-user-component-entry.ts:31
       2  node_modules/adminjs/src/backend/decorators/resource/utils/decorate-actions.ts:41
       1  node_modules/adminjs/src/backend/decorators/resource/utils/get-navigation.ts:52
       1  node_modules/adminjs/src/backend/utils/view-helpers/view-helpers.ts:79
       1  node_modules/adminjs/src/frontend/components/app/action-button/action-button.tsx:42
       6  node_modules/adminjs/src/frontend/components/app/default-dashboard.tsx:31
       1  node_modules/adminjs/src/frontend/components/app/records-table/no-records.tsx:25
       2  node_modules/adminjs/src/frontend/components/app/sidebar/sidebar.tsx:6
       4  node_modules/adminjs/src/frontend/components/app/top-bar.tsx:45
       3  node_modules/adminjs/src/frontend/components/login/index.tsx:73
  error Command failed with exit code 2.
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

package.json

  {
    "name": "nestjs-boilerplate",
    "version": "8.0.0",
    "description": "Awesome NestJS Boilerplate, Typescript, Postgres, TypeORM",
    "author": "Narek Hakobyan <narek.hakobyan.07@gmail.com>",
    "private": true,
    "license": "MIT",
    "scripts": {
      "prebuild:prod": "rimraf dist",
      "build:prod": "tsc -p tsconfig.build.json && cp package.json dist/ && cp -r .ebextensions dist/.ebextensions/ && cp -r .platform/ dist/.platform/",
      "postbuild:prod": "copyfiles --up 1 src/**/*.json dist",
      "start:hmr": "node dist/main.hmr.ts",
      "start:dev": "ts-node src/main.ts",
      "start:prod": "node dist/main.js",
      "typeorm": "ts-node node_modules/typeorm/cli.js -f ormconfig",
      "migration:generate": "yarn run typeorm migration:generate -d src/database/migrations -n",
      "migration:create": "yarn run typeorm migration:create -d src/database/migrations -n",
      "seed:config": "ts-node node_modules/typeorm-seeding/dist/cli.js config",
      "seed:run": "ts-node node_modules/typeorm-seeding/dist/cli.js seed",
      "new": "hygen new",
      "migration:revert": "yarn run typeorm migration:revert",
      "schema:drop": "yarn run typeorm schema:drop",
      "watch:dev": "ts-node-dev src/main.ts",
      "debug:dev": "cross-env TS_NODE_CACHE=false ts-node-dev --inspect --ignore '/^src/.*\\.spec\\.ts$/' src/main.ts",
      "webpack": "webpack --config webpack.config.js --progress",
      "lint": "eslint . --ext .ts",
      "lint:fix": "eslint --fix . --ext .ts",
      "test": "NODE_ENV=test jest",
      "test:watch": "NODE_ENV=test jest --watch",
      "test:cov": "NODE_ENV=test jest --coverage",
      "test:debug": "NODE_ENV=test node --inspect-brk -r ts-node/register node_modules/.bin/jest --runInBand",
      "copy:lib": "cpx 'src/lib/**/{files,workspace}/**/*.*' dist/lib && cpx 'src/lib/**/{files,workspace}/**/.!(gitignore)' dist/lib",
      "test:e2e": "NODE_ENV=test jest --config ./test/jest-e2e.json",
      "docs:dev": "vuepress dev -p 7070",
      "docs:build": "DEPLOY_ENV=gh-pages vuepress build",
      "docs:deploy": "yarn docs:build && gh-pages -d .vuepress/dist",
      "prepare": "husky install",
      "prerelease": "yarn docs:deploy",
      "release": "release-it"
    },
    "dependencies": {
      "@adminjs/express": "^4.1.0",
      "@adminjs/nestjs": "^4.0.1",
      "@adminjs/passwords": "^2.0.1",
      "@adminjs/typeorm": "^2.0.2",
      "@nanogiants/nestjs-swagger-api-exception-decorator": "^1.6.0",
      "@nestjs/axios": "^0.0.7",
      "@nestjs/common": "^8.2.6",
      "@nestjs/config": "^1.1.6",
      "@nestjs/core": "^8.2.6",
      "@nestjs/cqrs": "^8.0.1",
      "@nestjs/jwt": "^8.0.0",
      "@nestjs/microservices": "^8.2.6",
      "@nestjs/passport": "^8.1.0",
      "@nestjs/platform-express": "^8.2.6",
      "@nestjs/swagger": "^5.1.5",
      "@nestjs/terminus": "^8.0.4",
      "@nestjs/typeorm": "^8.0.3",
      "@sentry/node": "^6.19.2",
      "@sentry/tracing": "^6.19.2",
      "@types/yargs": "^17.0.10",
      "add": "^2.0.6",
      "adminjs": "^5.10.0",
      "aws-sdk": "^2.1102.0",
      "bcrypt": "^5.0.1",
      "cache-manager-redis-store": "^2.0.0",
      "class-transformer": "^0.5.1",
      "class-validator": "^0.13.2",
      "compression": "^1.7.4",
      "express": "^4.18.0",
      "express-ctx": "^0.1.1",
      "express-formidable": "^1.2.0",
      "express-rate-limit": "^6.2.0",
      "express-session": "^1.17.2",
      "helmet": "^5.0.2",
      "joi": "^17.6.0",
      "jsonwebtoken": "^8.5.1",
      "lodash": "^4.17.21",
      "mime-types": "^2.1.34",
      "morgan": "^1.10.0",
      "multer": "^1.4.4",
      "multer-s3": "^2.10.0",
      "nats": "^2.2.0",
      "nestjs-command": "^3.1.1",
      "nestjs-i18n": "^8.2.2",
      "passport": "^0.5.2",
      "passport-jwt": "^4.0.0",
      "pg": "^8.7.3",
      "reflect-metadata": "^0.1.13",
      "rxjs": "^7.5.4",
      "source-map-support": "^0.5.21",
      "swagger-ui-express": "^4.3.0",
      "typeorm": "^0.2.41",
      "typeorm-transactional-cls-hooked": "^0.1.21",
      "uuid": "^8.3.2",
      "yargs": "^17.4.0",
      "yarn": "^1.22.18"
    },
    "devDependencies": {
      "@handfish/hygen": "^6.1.3",
      "@moneteam/eslint-plugin-nestjs": "^1.2.0",
      "@nestjs/cli": "^8.2.0",
      "@nestjs/testing": "^8.2.6",
      "@types/bcrypt": "^5.0.0",
      "@types/cache-manager-redis-store": "^2.0.1",
      "@types/compression": "^1.7.2",
      "@types/express": "^4.17.13",
      "@types/jest": "^27.4.0",
      "@types/jsonwebtoken": "^8.5.8",
      "@types/lodash": "^4.14.178",
      "@types/mime-types": "^2.1.1",
      "@types/morgan": "^1.9.3",
      "@types/node": "^16.11.12",
      "@types/passport-jwt": "^3.0.6",
      "@types/supertest": "^2.0.11",
      "@types/uuid": "^8.3.4",
      "@types/webpack-env": "^1.16.3",
      "@typescript-eslint/eslint-plugin": "^5.10.2",
      "@typescript-eslint/parser": "^5.10.2",
      "clean-webpack-plugin": "^4.0.0",
      "copyfiles": "^2.4.1",
      "cpx": "^1.5.0",
      "cross-env": "^7.0.3",
      "eslint": "^8.9.0",
      "eslint-config-prettier": "^8.3.0",
      "eslint-import-resolver-typescript": "^2.5.0",
      "eslint-plugin-import": "^2.25.4",
      "eslint-plugin-import-helpers": "^1.2.1",
      "eslint-plugin-prettier": "^4.0.0",
      "eslint-plugin-simple-import-sort": "^7.0.0",
      "eslint-plugin-sonarjs": "^0.12.0",
      "eslint-plugin-unicorn": "^41.0.0",
      "gh-pages": "^3.2.3",
      "husky": "^7.0.4",
      "jest": "^27.5.1",
      "lint-staged": "~12.3.2",
      "prettier": "^2.5.0",
      "release-it": "^14.12.4",
      "supertest": "^6.2.2",
      "ts-jest": "^27.1.3",
      "ts-loader": "^9.2.6",
      "ts-node": "^10.4.0",
      "ts-node-dev": "^1.1.8",
      "typeorm-seeding": "^1.6.1",
      "typescript": "^4.5.5",
      "vuepress": "^2.0.0-beta.35",
      "webpack": "^5.68.0",
      "webpack-cli": "^4.9.2",
      "webpack-node-externals": "^3.0.0"
    },
    "resolutions": {
      "@types/react": "^18.0.8"
    },
    "jest": {
      "moduleFileExtensions": [
        "js",
        "json",
        "ts"
      ],
      "rootDir": "src",
      "testRegex": ".spec.ts$",
      "transform": {
        "^.+\\.(t|j)s$": "ts-jest"
      },
      "coverageDirectory": "../coverage",
      "testEnvironment": "node"
    }
  }

.eslintrc.js

  module.exports = {
    parser: '@typescript-eslint/parser',
    env: {
      jest: true,
      es6: true,
      node: true,
    },
    ignorePatterns: ['.eslintrc.js'],
    parserOptions: {
      ecmaVersion: 2018,
      project: './tsconfig.eslint.json',
      sourceType: 'module',
    },
    extends: [
      'plugin:import/typescript',
      'plugin:prettier/recommended',
      'eslint:recommended',
      'plugin:@typescript-eslint/recommended',
      'plugin:@typescript-eslint/recommended-requiring-type-checking',
      'plugin:@typescript-eslint/eslint-recommended',
      'plugin:@moneteam/nestjs/recommended',
    ],
    plugins: [
      '@typescript-eslint',
      'prettier',
      'simple-import-sort',
      'import',
      'unicorn',
      'sonarjs',
      '@moneteam/nestjs',
    ],
    rules: {
      'prettier/prettier': [
        'off',
        { singleQuote: true, trailingComma: 'all', tabWidth: 2, bracketSpacing: true },
      ],
      /**
       * plugin:import
       */
      'import/export': 'off',
      'import/first': 'off',
      'import/no-unresolved': 'off',
      'import/named': 'off',
      'import/namespace': 'off',
      'import/no-duplicates': 'off',
      'import/no-relative-packages': 'off',
      'import/newline-after-import': 'off',
      'import/no-absolute-path': 'off',
      'import/no-default-export': 'off',
      'import/no-self-import': 'off',
      'import/no-deprecated': 'off',
      'import/no-cycle': 'off',
      'import/no-unused-modules': 'off',
      // 'import/no-namespace': 'off',
      'import/extensions': ['off', 'never'],
      'import/no-useless-path-segments': [
        'off',
        {
          noUselessIndex: true,
        },
      ],
      'import/no-internal-modules': 'off',
      'import/order': 'off',
      /**
       * plugin:sonarjs
       */
      'sonarjs/cognitive-complexity': 'off',
      'sonarjs/elseif-without-else': 'off',
      'sonarjs/no-all-duplicated-branches': 'off',
      'sonarjs/no-collapsible-if': 'off',
      'sonarjs/no-collection-size-mischeck': 'off',
      'sonarjs/no-empty-collection': 'off',
      'sonarjs/no-identical-conditions': 'off',
      'sonarjs/no-identical-expressions': 'off',
      'sonarjs/no-inverted-boolean-check': 'off',
      'sonarjs/no-ignored-return': 'off',
      'sonarjs/no-identical-functions': 'off',
      'sonarjs/no-redundant-boolean': 'off',
      'sonarjs/no-redundant-jump': 'off',
      'sonarjs/no-unused-collection': 'off',
      'sonarjs/no-useless-catch': 'off',
      'sonarjs/prefer-object-literal': 'off',
      'sonarjs/prefer-single-boolean-return': 'off',
      'sonarjs/no-use-of-empty-return-value': 'off',
      'sonarjs/no-gratuitous-expressions': 'off',
      'sonarjs/no-duplicate-string': 'off',
      /**
       * plugin:simple-import-sort
       */
      'simple-import-sort/imports': 'off',
      'simple-import-sort/exports': 'off',
      /**
       * plugin:typescript-eslint
       */
      'no-unused-vars': 'off',
      '@typescript-eslint/no-unused-vars': ['off', { argsIgnorePattern: '^_' }],
      '@typescript-eslint/adjacent-overload-signatures': 'off',
      '@typescript-eslint/array-type': ['off', { default: 'array-simple' }],
      '@typescript-eslint/ban-types': [
        'off',
        {
          types: {
            Object: {
              message: 'Avoid using the `Object` type. Did you mean `object`?',
            },
            Function: {
              message:
                'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
            },
            Boolean: {
              message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
              fixWith: 'boolean',
            },
            Number: {
              message: 'Avoid using the `Number` type. Did you mean `number`?',
              fixWith: 'number',
            },
            Symbol: {
              message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
              fixWith: 'symbol',
            },
            String: {
              message: 'Avoid using the `String` type. Did you mean `string`?',
              fixWith: 'string',
            },
            '{}': {
              message: 'Use Record<K, V> instead',
              fixWith: 'Record<K, V>',
            },
            object: {
              message: 'Use Record<K, V> instead',
              fixWith: 'Record<K, V>',
            },
          },
        },
      ],
      '@typescript-eslint/explicit-member-accessibility': [
        'off',
        {
          overrides: {
            constructors: 'off',
          },
        },
      ],
      // '@typescript-eslint/indent': 'off',
      '@typescript-eslint/member-delimiter-style': [
        'off',
        {
          multiline: {
            delimiter: 'semi',
            requireLast: true,
          },
          singleline: {
            delimiter: 'semi',
            requireLast: false,
          },
        },
      ],
      '@typescript-eslint/member-ordering': 'off',
      '@typescript-eslint/no-angle-bracket-type-assertion': 'off',
      '@typescript-eslint/no-empty-function': 'off',
      '@typescript-eslint/no-empty-interface': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      '@typescript-eslint/no-inferrable-types': 'off',
      '@typescript-eslint/await-thenable': 'off',
      '@typescript-eslint/ban-ts-comment': 'off',
      '@typescript-eslint/ban-tslint-comment': 'off',
      '@typescript-eslint/consistent-indexed-object-style': 'off',
      '@typescript-eslint/consistent-type-definitions': ['off', 'interface'],
      '@typescript-eslint/consistent-type-imports': ['off', { prefer: 'type-imports' }],
      '@typescript-eslint/no-misused-new': 'off',
      '@typescript-eslint/no-unsafe-assignment': 'off',
      '@typescript-eslint/no-unsafe-call': 'off',
      '@typescript-eslint/no-unsafe-member-access': 'off',
      '@typescript-eslint/no-unsafe-return': 'off',
      '@typescript-eslint/restrict-template-expressions': 'off',
      '@typescript-eslint/no-require-imports': 'off',
      'keyword-spacing': 'off',
      '@typescript-eslint/keyword-spacing': 'off',
      '@typescript-eslint/no-namespace': 'off',
      '@typescript-eslint/no-this-alias': 'off',
      '@typescript-eslint/no-use-before-define': 'off',
      '@typescript-eslint/no-use-before-declare': 'off',
      '@typescript-eslint/no-var-requires': 'off',
      '@typescript-eslint/prefer-for-of': 'off',
      '@typescript-eslint/prefer-function-type': 'off',
      '@typescript-eslint/prefer-namespace-keyword': 'off',
      '@typescript-eslint/quotes': [
        'off',
        'single',
        {
          avoidEscape: true,
        },
      ],
      '@typescript-eslint/semi': ['off', 'always'],
      '@typescript-eslint/naming-convention': [
        'off',
        {
          selector: 'default',
          format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'],
          filter: {
            regex: '^_.*$',
            match: false,
          },
        },
        {
          selector: 'variable',
          format: ['camelCase', 'UPPER_CASE'],
        },
        {
          selector: 'interface',
          format: ['PascalCase'],
          prefix: ['I'],
        },
        {
          selector: 'typeLike',
          format: ['PascalCase'],
        },
        {
          selector: 'memberLike',
          modifiers: ['private'],
          format: ['camelCase'],
          leadingUnderscore: 'forbid',
        },
        {
          selector: 'variable',
          types: ['boolean'],
          format: ['PascalCase'],
          prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
        },
      ],
      '@typescript-eslint/type-annotation-spacing': 'off',
      '@typescript-eslint/unified-signatures': 'off',
      '@typescript-eslint/interface-name-prefix': 'off',
      '@typescript-eslint/no-non-null-assertion': 'off',
      '@typescript-eslint/no-duplicate-imports': ['off'],
      '@typescript-eslint/no-shadow': 'off',
      '@typescript-eslint/no-unused-expressions': ['off'],
      /**
       * plugin:eslint
       */
      'no-await-in-loop': 'off',
      'padding-line-between-statements': [
        'off',
        { blankLine: 'always', prev: '*', next: 'return' },
        { blankLine: 'always', prev: '*', next: 'try' },
        { blankLine: 'always', prev: 'try', next: '*' },
        { blankLine: 'always', prev: '*', next: 'block-like' },
        { blankLine: 'always', prev: 'block-like', next: '*' },
        { blankLine: 'always', prev: '*', next: 'throw' },
        { blankLine: 'always', prev: 'var', next: '*' },
      ],
      'arrow-body-style': 'off',
      'arrow-parens': ['off', 'always'],
      complexity: 'off',
      'no-restricted-imports': [
        'off',
        {
          paths: [
            {
              name: 'rxjs/Rx',
              message: "Please import directly from 'rxjs' instead",
            },
          ],
        },
      ],
      'object-curly-spacing': ['off', 'always'],
      'no-multi-spaces': 'off',
      'no-useless-return': 'off',
      'no-else-return': 'off',
      'no-implicit-coercion': 'off',
      'constructor-super': 'off',
      yoda: 'off',
      strict: ['off', 'never'],
      curly: 'off',
      'dot-notation': 'off',
      'eol-last': 'off',
      eqeqeq: ['off', 'smart'],
      'guard-for-in': 'off',
      'id-match': 'off',
      'max-classes-per-file': ['off', 2],
      'max-len': [
        'off',
        {
          code: 150,
        },
      ],
      'new-parens': 'off',
      'no-bitwise': 'off',
      'no-caller': 'off',
      'no-cond-assign': 'off',
      'no-constant-condition': 'off',
      'no-dupe-else-if': 'off',
      'lines-between-class-members': ['off', 'always'],
      'no-console': [
        'off',
        {
          allow: [
            'info',
            'dirxml',
            'warn',
            'off',
            'dir',
            'timeLog',
            'assert',
            'clear',
            'count',
            'countReset',
            'group',
            'groupCollapsed',
            'groupEnd',
            'table',
            'Console',
            'markTimeline',
            'profile',
            'profileEnd',
            'timeline',
            'timelineEnd',
            'timeStamp',
            'context',
          ],
        },
      ],
      'no-debugger': 'off',
      'no-duplicate-case': 'off',
      'no-duplicate-imports': 'off',
      'no-empty': 'off',
      'no-eval': 'off',
      'no-extra-bind': 'off',
      'no-fallthrough': 'off',
      'no-invalid-this': 'off',
      'no-irregular-whitespace': 'off',
      'no-multiple-empty-lines': [
        'off',
        {
          max: 1,
        },
      ],
      'no-new-func': 'off',
      'no-new-wrappers': 'off',
      'no-redeclare': 'off',
      'no-return-await': 'off',
      'no-sequences': 'off',
      'no-sparse-arrays': 'off',
      'no-template-curly-in-string': 'off',
      'no-shadow': 'off',
      'no-throw-literal': 'off',
      'no-trailing-spaces': 'off',
      'no-undef-init': 'off',
      'no-unsafe-finally': 'off',
      'no-unused-expressions': 'off',
      'no-unused-labels': 'off',
      'no-var': 'off',
      'object-shorthand': 'off',
      'prefer-const': 'off',
      'prefer-object-spread': 'off',
      'quote-props': ['off', 'consistent-as-needed'],
      radix: 'off',
      'use-isnan': 'off',
      'valid-typeof': 'off',
      'space-before-function-paren': 'off',
      /**
       * plugin:unicorn
       */
      'unicorn/better-regex': 'off',
      'unicorn/catch-off-name': 'off',
      'unicorn/consistent-destructuring': 'off',
      'unicorn/consistent-function-scoping': 'off',
      'unicorn/custom-off-definition': 'off',
      'unicorn/empty-brace-spaces': 'off',
      'unicorn/off-message': 'off',
      'unicorn/escape-case': 'off',
      'unicorn/expiring-todo-comments': 'off',
      'unicorn/explicit-length-check': 'off',
      'unicorn/filename-case': [
        'off',
        {
          cases: {
            kebabCase: true,
            pascalCase: true,
          },
        },
      ],
      'unicorn/import-index': 'off',
      'unicorn/import-style': 'off',
      'unicorn/new-for-builtins': 'off',
      'unicorn/no-abusive-eslint-disable': 'off',
      'unicorn/no-array-callback-reference': 'off',
      'unicorn/no-array-for-each': 'off',
      'unicorn/no-array-push-push': 'off',
      'unicorn/no-array-reduce': 'off',
      'unicorn/no-console-spaces': 'off',
      'unicorn/no-document-cookie': 'off',
      'unicorn/no-for-loop': 'off',
      'unicorn/no-hex-escape': 'off',
      'unicorn/no-instanceof-array': 'off',
      'unicorn/no-keyword-prefix': 'off',
      'unicorn/no-lonely-if': 'off',
      'no-nested-ternary': 'off',
      'unicorn/no-nested-ternary': 'off',
      'unicorn/no-new-array': 'off',
      'unicorn/no-new-buffer': 'off',
      'unicorn/no-null': 'off',
      'unicorn/no-object-as-default-parameter': 'off',
      'unicorn/no-process-exit': 'off',
      'unicorn/no-static-only-class': 'off',
      'unicorn/no-this-assignment': 'off',
      'unicorn/no-unreadable-array-destructuring': 'off',
      'unicorn/no-unsafe-regex': 'off',
      'unicorn/no-unused-properties': 'off',
      'unicorn/no-useless-undefined': 'off',
      'unicorn/no-zero-fractions': 'off',
      'unicorn/number-literal-case': 'off',
      'unicorn/numeric-separators-style': 'off',
      'unicorn/prefer-add-event-listener': 'off',
      'unicorn/prefer-array-find': 'off',
      'unicorn/prefer-array-flat': 'off',
      'unicorn/prefer-array-flat-map': 'off',
      'unicorn/prefer-array-index-of': 'off',
      'unicorn/prefer-array-some': 'off',
      'unicorn/prefer-date-now': 'off',
      'unicorn/prefer-default-parameters': 'off',
      'unicorn/prefer-dom-node-append': 'off',
      'unicorn/prefer-dom-node-dataset': 'off',
      'unicorn/prefer-dom-node-remove': 'off',
      'unicorn/prefer-dom-node-text-content': 'off',
      'unicorn/prefer-includes': 'off',
      'unicorn/prefer-keyboard-event-key': 'off',
      'unicorn/prefer-math-trunc': 'off',
      'unicorn/prefer-modern-dom-apis': 'off',
      'unicorn/prefer-module': 'off',
      'unicorn/prefer-negative-index': 'off',
      'unicorn/prefer-node-protocol': 'off',
      'unicorn/prefer-number-properties': 'off',
      'unicorn/prefer-optional-catch-binding': 'off',
      'unicorn/prefer-reflect-apply': 'off',
      'unicorn/prefer-regexp-test': 'off',
      'unicorn/prefer-set-has': 'off',
      'unicorn/prefer-spread': 'off',
      'unicorn/prefer-string-replace-all': 'off',
      'unicorn/prefer-string-slice': 'off',
      'unicorn/prefer-string-starts-ends-with': 'off',
      'unicorn/prefer-string-trim-start-end': 'off',
      'unicorn/prefer-switch': 'off',
      'unicorn/prefer-ternary': 'off',
      'unicorn/prefer-type-off': 'off',
      'unicorn/prevent-abbreviations': 'off',
      'unicorn/string-content': 'off',
      'unicorn/throw-new-off': 'off',
    },
  };
nemo-market-dev commented 2 years ago
스크린샷 2022-04-27 오후 7 36 32
dziraf commented 2 years ago

Are you using React 18? Explicit children prop shouldn't be required pre-18

nemo-market-dev commented 2 years ago

@dziraf Thanks for reply!~

I tried with "@types/react": "~17.0.39" but not working yet.

"resolutions": { "@types/react": "~17.0.39" },

react's version: "16.14.0"

dziraf commented 2 years ago

You should be able to build the app if you add:

  "skipLibCheck": true

to your tsconfig until it gets investigated

nemo-market-dev commented 2 years ago
스크린샷 2022-05-04 오후 4 00 48

Of course I added! Sorry for not working...

dziraf commented 2 years ago

I only noticed it now but you have:

      "@types/react": "^18.0.8"

AdminJS uses React v16, so it will throw errors if you use v18 to resolve types. You either need to downgrade the types to v16 or ignore type errors in AdminJS components.