nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.75k stars 2.37k forks source link

enforce-module-boundaries error, did not find .tsx,find .ts only #29016

Open LesterWeng opened 1 day ago

LesterWeng commented 1 day ago

Current Behavior

eslint . --fix meet a error which is caused by Rule: "@nx/enforce-module-boundaries"

Expected Behavior

eslint . --fix can execute success

GitHub Repo

No response

Steps to Reproduce

1.in a tsx,use import { DatePicker } from '@pos/widget',DatePicker is a tsx and not as ts

  1. run eslint . --fix

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.15.1
OS     : darwin-arm64
pnpm   : 9.12.2

nx (global)        : 19.4.3
nx                 : 19.4.3
@nx/js             : 19.4.3
@nx/jest           : 19.4.3
@nx/eslint         : 19.4.3
@nx/workspace      : 19.4.3
@nx/eslint-plugin  : 19.4.3
@nx/react          : 19.4.3
@nx/vite           : 19.4.3
@nx/web            : 19.4.3
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

[Error - 11:19:21] An unexpected error occurred:
[Error - 11:19:21] Error: ENOENT: no such file or directory, open '/Users/lester/Documents/Menusifu/cloud-pos-front/libs/widget/src/base/date-picker/index.ts'
Occurred while linting /Users/lester/Documents/Menusifu/cloud-pos-front/libs/widget/src/gift-card/components/base-card/index.tsx:4
Rule: "@nx/enforce-module-boundaries"
    at readFileSync (node:fs:448:20)
    at t.readFileSync (node:electron/js2c/node_init:2:9900)
    at hasMemberExport (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/@nx+eslint-plugin@19.4.3_@babel+traverse@7.23.9_@swc-node+register@1.9.2_@swc+core@1.5.29_@sw_r6cnujfukzoba4w7fqzwdebsdu/node_modules/@nx/eslint-plugin/src/utils/ast-utils.js:75:47)
    at getRelativeImportPath (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/@nx+eslint-plugin@19.4.3_@babel+traverse@7.23.9_@swc-node+register@1.9.2_@swc+core@1.5.29_@sw_r6cnujfukzoba4w7fqzwdebsdu/node_modules/@nx/eslint-plugin/src/utils/ast-utils.js:210:17)
    at Object.fix (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/@nx+eslint-plugin@19.4.3_@babel+traverse@7.23.9_@swc-node+register@1.9.2_@swc+core@1.5.29_@sw_r6cnujfukzoba4w7fqzwdebsdu/node_modules/@nx/eslint-plugin/src/rules/enforce-module-boundaries.js:265:98)
    at normalizeFixes (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/report-translator.js:194:28)
    at /Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/report-translator.js:365:49
    at Object.report (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/linter.js:1047:41)
    at run (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/@nx+eslint-plugin@19.4.3_@babel+traverse@7.23.9_@swc-node+register@1.9.2_@swc+core@1.5.29_@sw_r6cnujfukzoba4w7fqzwdebsdu/node_modules/@nx/eslint-plugin/src/rules/enforce-module-boundaries.js:243:29)
    at ImportDeclaration (/Users/lester/Documents/Menusifu/cloud-pos-front/node_modules/.pnpm/@nx+eslint-plugin@19.4.3_@babel+traverse@7.23.9_@swc-node+register@1.9.2_@swc+core@1.5.29_@sw_r6cnujfukzoba4w7fqzwdebsdu/node_modules/@nx/eslint-plugin/src/rules/enforce-module-boundaries.js:481:17)

Package Manager Version

No response

Operating System

Additional Information

No response