vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.21k stars 1.81k forks source link

[turborepo] - Unable to resolve any module during "turbo lint". #5909

Closed 9vfQbg7z4ajrGQxR closed 1 year ago

9vfQbg7z4ajrGQxR commented 1 year ago

What version of Turborepo are you using?

1.10.13

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Linux

Describe the Bug

lint turbo lint

• Packages in scope: docs, eslint-config-custom, tailwind-config, tsconfig, ui, web • Running lint in 6 packages • Remote caching disabled ui:lint: cache hit (outputs already on disk), replaying logs 2a04b9abd2481f3f ui:lint: ui:lint: > ui@0.0.0 lint ui:lint: > eslint src/ ui:lint: web:lint: cache miss, executing 5f9058d103d9e696 docs:lint: cache hit (outputs already on disk), replaying logs 3ea306e6c4a186ba docs:lint: docs:lint: > docs@1.0.0 lint docs:lint: > next lint docs:lint: docs:lint: docs:lint: ./src/app/page.tsx docs:lint: 2:22 Error: Unable to resolve path to module 'ui'. import/no-unresolved docs:lint: docs:lint: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules docs:lint: npm ERR! Lifecycle script lint failed with error: docs:lint: npm ERR! Error: command failed docs:lint: npm ERR! in workspace: docs@1.0.0 docs:lint: npm ERR! at location: /home/dev/my-turborepo/apps/docs web:lint: web:lint: > web@1.0.0 lint web:lint: > next lint web:lint: web:lint: Failed to load config "custom" to extend from. web:lint: Referenced from: /home/dev/my-turborepo/apps/web/.eslintrc.js web:lint: npm ERR! Lifecycle script lint failed with error: web:lint: npm ERR! Error: command failed web:lint: npm ERR! in workspace: web@1.0.0 web:lint: npm ERR! at location: /home/dev/my-turborepo/apps/web

Tasks: 3 successful, 3 total Cached: 2 cached, 3 total Time: 656ms

Expected Behavior

Let eslint understand the setup between my apps and eslint's custom config through turborepo.

To Reproduce

You just need to checkout the following example project: https://github.com/vercel/turbo/tree/main/examples/with-tailwind

And just run: yarn lint

Reproduction Repo

https://github.com/vercel/turbo/tree/main/examples/with-tailwind

tknickman commented 1 year ago

Good catch, you can try out the fix with:

npx create-turbo@canary with-tailwind npm -e https://github.com/vercel/turbo/tree/fix_examples_import_rule/examples/with-tailwind
GeKVe commented 1 year ago

Thank you so much, both of you! 🥇