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

Dependency issues when used within folder with name being a superset of parent's folder #516

Open
5 of 7 tasks
JoJk0 opened this issue Jun 26, 2024 · 0 comments
Open
5 of 7 tasks

Comments

@JoJk0
Copy link

JoJk0 commented Jun 26, 2024

Describe the bug

When using @antfu/eslint-config in a project on Windows that has a folder name that is a superset of parent folder's name, lint command is throwing the following error:

> eslint . "--fix"


Oops! Something went wrong! :(

ESLint: 9.3.0

Error: Cannot find package 'C:\...\***\***.Client\node_modules\.pnpm\@[email protected]_@[email protected][email protected][email protected]__@vue+_r4q2j7aafpdnjhsogjebmzyegi\node_modules\eslint-plugin-eslint-comments\package.json' imported from C:\...\****\***.Client\node_modules\.pnpm\@[email protected]_@[email protected][email protected][email protected]__@vue+_r4q2j7aafpdnjhsogjebmzyegi\node_modules\@antfu\eslint-config\dist\index.js 
Did you mean to import [email protected][email protected]/node_modules/eslint-plugin-eslint-comments/index.js?
    at legacyMainResolve (node:internal/modules/esm/resolve:205:26)
    at packageResolve (node:internal/modules/esm/resolve:831:14)
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1121:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36)
 ELIFECYCLE  Command failed with exit code 2.

This happens as soon as @antfu/eslint-config is being imported inside eslint.config.js file

Reproduction

  1. On Windows. create My.Project folder 2. Create My.Project.Client folder inside My.Project folder 3. Clone vitesse starter template into My.Project.Client folder. 4. Install packages and run pnpm lint

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (4) x64 AMD EPYC 7763 64-Core Processor
    Memory: 3.15 GB / 15.95 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.1.1 - C:\...\***\***.Client\node_modules\.bin\pnpm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.68)
    Internet Explorer: 11.0.22621.3527

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant