Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Migrate no-extra-semi rules into user config, out of nx extendable configs #26306

Closed
1 of 4 tasks
p-iknow opened this issue Jun 1, 2024 · 1 comment · Fixed by #26317
Closed
1 of 4 tasks
Assignees
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug

Comments

@p-iknow
Copy link

p-iknow commented Jun 1, 2024

Current Behavior

When running pnpm exec nx migrate --run-migrations --verbose on NX version 19.1, the following error occurs as shown in the image below.

Upon debugging, it was identified that the json.rule field is undefined, which is causing the error.

image

TypeError: Cannot read properties of undefined (reading '@typescript-eslint/no-extra-semi')
at addNoExtraSemiExplicitly (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:48:20)
at /Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:22:45
at updateJson (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/generators/utils/json.js:46:26)
at /Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:16:33
at visitNotIgnoredFiles (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+devkit@19.1.1_nx@19.1.1/node_modules/@nx/devkit/src/generators/visit-not-ignored-files.js:31:13)
at migrate (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:5:39)
at runNxMigration (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:1039:11)
at executeMigrations (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:902:39)
at runMigrations (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:987:43)
at /Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:1056:19

Expected Behavior

I hope the migration command runs successfully without errors.

GitHub Repo

No response

Steps to Reproduce

pnpm exec nx migrate --run-migrations --verbose with below file

{
  "root": true,
  "ignorePatterns": ["**/*"],
  "extends": [
    "./libs/configs/eslint-config-banksalad/.eslintrc.common.js",
    "plugin:storybook/recommended"
  ],
  "plugins": ["@nx", "jsdoc"],
  "overrides": [
    {
      "files": ["*.ts"],
      "rules": {
        "jsdoc/require-jsdoc": [
          "error",
          {
            "publicOnly": {
              "ancestorsOnly": true
            },
            "require": {
              "FunctionDeclaration": true,
              "MethodDefinition": true,
              "ClassDeclaration": true,
              "ArrowFunctionExpression": true,
              "FunctionExpression": true
            }
          }
        ]
      }
    },
    {
      "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
      "rules": {
        "import/no-cycle": ["off"],
        "@nx/enforce-module-boundaries": [
          "error",
          {
            "enforceBuildableLibDependency": true,
            "allowCircularSelfDependency": true,
            "allow": [],
            "depConstraints": [
              {
                "sourceTag": "type:app",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:third-parties",
                  "type:ui-core",
                  "type:ui-extend",
                  "type:next",
                  "type:react",
                  "type:feature",
                  "type:shared-features",
                  "type:data-access",
                  "type:service",
                  "type:style",
                  "type:definition",
                  "type:sentry"
                ]
              },
              {
                "sourceTag": "type:service",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:third-parties",
                  "type:ui-core",
                  "type:ui-extend",
                  "type:next",
                  "type:react",
                  "type:style",
                  "type:dictionary",
                  "type:feature",
                  "type:shared-features",
                  "type:data-access",
                  "type:sentry"
                ]
              },
              {
                "sourceTag": "type:next",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:react",
                  "type:ui-core",
                  "type:ui-extend",
                  "type:definition",
                  "type:sentry"
                ]
              },
              {
                "sourceTag": "type:react",
                "onlyDependOnLibsWithTags": ["type:util", "type:definition", "type:sentry"]
              },
              {
                "sourceTag": "type:sentry",
                "onlyDependOnLibsWithTags": ["type:util", "type:definition", "type:axios"]
              },
              {
                "sourceTag": "type:style",
                "onlyDependOnLibsWithTags": []
              },
              {
                "sourceTag": "type:dictionary",
                "onlyDependOnLibsWithTags": []
              },
              {
                "sourceTag": "type:ui-core",
                "onlyDependOnLibsWithTags": ["type:ui-core", "type:util"]
              },
              {
                "sourceTag": "type:ui-extend",
                "onlyDependOnLibsWithTags": ["type:ui-core", "type:ui-extend", "type:util"]
              },
              {
                "sourceTag": "type:generator",
                "onlyDependOnLibsWithTags": ["type:generator", "type:util"]
              },
              {
                "sourceTag": "type:util",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:third-parties",
                  "type:sentry"
                ]
              },
              {
                "sourceTag": "type:third-parties",
                "onlyDependOnLibsWithTags": ["type:util"]
              },
              {
                "sourceTag": "type:feature",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:third-parties",
                  "type:ui-core",
                  "type:ui-extend",
                  "type:next",
                  "type:react",
                  "type:data-access",
                  "type:shared-features",
                  "type:definition",
                  "type:sentry"
                ]
              },
              {
                "sourceTag": "type:shared-features",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:third-parties",
                  "type:ui-core",
                  "type:ui-extend",
                  "type:next",
                  "type:react",

                  "type:data-access",
                  "type:definition",
                  "type:sentry"
                ]
              },
              {
                "sourceTag": "type:data-access",
                "onlyDependOnLibsWithTags": [
                  "type:util",
                  "type:ui-core",
                  "type:ui-extend",
                  "type:next",
                  "type:definition",
                  "type:sentry"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "files": [
        "app/**/page.tsx",
        "app/**/layout.tsx",
        "app/**/template.tsx",
        "app/**/loading.tsx",
        "app/**/not-found.tsx",
        "app/**/error.tsx",
        "app/**/global-error.tsx",
        "app/**/template.tsx",
        "app/**/default.tsx",
        "app/**/route.ts",
        "app/**/api/*.ts"
      ],
      "rules": {
        "import/no-default-export": ["off"]
      }
    },
    {
      "files": ["*.js", "*.jsx"],
      "extends": ["plugin:@nx/javascript"]
    },
    {
      "files": "*.json",
      "parser": "jsonc-eslint-parser",
      "rules": {}
    }
  ],
  "settings": {
    "import/parsers": {
      "@typescript-eslint/parser": [".ts", ".tsx"]
    },
    "import/resolver": {
      "node": {
        "extensions": [".js", ".ts", ".jsx", ".tsx", ".json"]
      },
      "typescript": {
        "alwaysTryTypes": true,
        "project": ["apps/*/tsconfig.json", "libs/*/tsconfig.json", "tsconfig.base.json"]
      }
    },
    "import/extensions": [".js", ".ts", ".mjs", ".jsx", ".tsx"]
  }
}

Nx Report

Node   : 20.12.0
OS     : darwin-arm64
pnpm   : 8.15.5

nx                 : 19.1.1
@nx/js             : 19.1.1
@nx/jest           : 19.1.1
@nx/linter         : 19.1.1
@nx/eslint         : 19.1.1
@nx/workspace      : 19.1.1
@nx/cypress        : 19.1.1
@nx/devkit         : 19.1.1
@nx/esbuild        : 19.1.1
@nx/eslint-plugin  : 19.1.1
@nx/next           : 19.1.1
@nx/plugin         : 19.1.1
@nx/react          : 19.1.1
@nx/rollup         : 19.1.1
@nx/storybook      : 19.1.1
@nrwl/tao          : 19.1.1
@nx/vite           : 19.1.1
@nx/web            : 19.1.1
@nx/webpack        : 19.1.1
nx-cloud           : 19.0.0
typescript         : 5.4.5
---------------------------------------
Community plugins:
ngx-deploy-npm : 7.0.1
---------------------------------------
Local workspace plugins:
         @bds-react-plugin
         @enterprise-web/monorepo-plugin

Failure Logs

NX   Failed to run update-19-1-0-rename-no-extra-semi from @nx/eslint-plugin. This workspace is NOT up to date!


 NX   Cannot read properties of undefined (reading '@typescript-eslint/no-extra-semi')

TypeError: Cannot read properties of undefined (reading '@typescript-eslint/no-extra-semi')
    at addNoExtraSemiExplicitly (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:48:20)
    at /Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:22:45
    at updateJson (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/generators/utils/json.js:46:26)
    at /Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:16:33
    at visitNotIgnoredFiles (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+devkit@19.1.1_nx@19.1.1/node_modules/@nx/devkit/src/generators/visit-not-ignored-files.js:31:13)
    at migrate (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/@nx+eslint-plugin@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96_@types+node@18.19.31_@type_z3thrkopcewvnszb45uejzpnpy/node_modules/@nx/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js:5:39)
    at runNxMigration (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:1039:11)
    at executeMigrations (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:902:39)
    at runMigrations (/Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@19.1.1_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/command-line/migrate/migrate.js:987:43)
    at /Users/youngchang/dev/workspace/enterprise-web/node_modules/.pnpm/nx@1

Package Manager Version

pnpm 8.15.5

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@leosvelperez leosvelperez added the scope: linter Issues related to Eslint support in Nx label Jun 3, 2024
@leosvelperez leosvelperez self-assigned this Jun 3, 2024
FrozenPandaz pushed a commit that referenced this issue Jun 3, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26306
FrozenPandaz pushed a commit that referenced this issue Jun 3, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26306

(cherry picked from commit adc1d70)
Copy link

github-actions bot commented Jul 6, 2024

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: linter Issues related to Eslint support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants