dan5py / turborepo-shadcn-ui

Turborepo starter with shadcn/ui pre-configured.
MIT License
466 stars 89 forks source link

pnpm lint command error #27

Closed mzavattaro closed 2 months ago

mzavattaro commented 2 months ago

Hi @dan5py good repo and it's on its way to being a great starting point for projects!

A couple things of note.

When running pnpm lint I see it throws an error:

> turborepo-shadcn-ui@1.2.1 lint /Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui
> turbo lint

• Packages in scope: @repo/eslint-config, @repo/typescript-config, @repo/ui, docs
• Running lint in 4 packages
• Remote caching disabled
@repo/ui:lint: cache hit, replaying logs 589e04928081172e
@repo/ui:lint: 
@repo/ui:lint: > @repo/ui@0.0.0 lint /Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui/packages/ui
@repo/ui:lint: > eslint .
@repo/ui:lint: 
docs:lint: cache miss, executing 002ae449ef3d2771
docs:lint: 
docs:lint: > docs@1.0.0 lint /Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui/apps/docs
docs:lint: > eslint . --max-warnings 0
docs:lint: 
docs:lint: 
docs:lint: /Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui/apps/docs/next.config.mjs
docs:lint:   0:0  error  Parsing error: ESLint was configured to run on `<tsconfigRootDir>/next.config.mjs` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.json
docs:lint: However, that TSConfig does not include this file. Either:
docs:lint: - Change ESLint's list of included files to not include this file
docs:lint: - Change that TSConfig to include this file
docs:lint: - Create a new TSConfig that includes this file and include it in your parserOptions.project
docs:lint: See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
docs:lint: 
docs:lint: /Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui/apps/docs/postcss.config.mjs
docs:lint:   0:0  error  Parsing error: ESLint was configured to run on `<tsconfigRootDir>/postcss.config.mjs` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.json
docs:lint: However, that TSConfig does not include this file. Either:
docs:lint: - Change ESLint's list of included files to not include this file
docs:lint: - Change that TSConfig to include this file
docs:lint: - Create a new TSConfig that includes this file and include it in your parserOptions.project
docs:lint: See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
docs:lint: 
docs:lint: ✖ 2 problems (2 errors, 0 warnings)
docs:lint: 
docs:lint:  ELIFECYCLE  Command failed with exit code 1.
docs:lint: ERROR: command finished with error: command (/Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui/apps/docs) /opt/homebrew/bin/pnpm run lint exited (1)
docs#lint: command (/Users/michaelzavattaro/Developer/test-turbo/turborepo-shadcn-ui/apps/docs) /opt/homebrew/bin/pnpm run lint exited (1)

 Tasks:    1 successful, 2 total
Cached:    1 cached, 2 total
  Time:    1.715s 
Failed:    docs#lint

 ERROR  run failed: command  exited (1)
 ELIFECYCLE  Command failed with exit code 1.

I was able to fix this by adding "**/*.mjs", to apps/docs/tsconfig.json.

Another thing I noticed is that the linting doesn't work at all out of the box. Not sure how to fix this, if there's specific VSCode settings to support this setup?

Thanks!

dan5py commented 2 months ago

Hi @mzavattaro, I'm fixing some issues today, this one too. For the linting on VSCode (if you want something visual rather then just a cli script), you can use the official ESLint extension by Microsoft. (Marketplace link)