leoroese/turborepo-tutorial

eslint couldn't find configuration file

princejoogie opened this issue · 3 comments

I cloned this repo and am getting an eslint error
image

Info

node version: 16.9.1
yarn version: 1.22.17
OS: Windows 11
image

Reproduction

  1. yarn install
  2. yarn format or make changes to either ui | next-app | server
  3. git add . && git commit -m 'message' // trigger husky
  4. step 3 fails

I'm also getting errors related to lint.
image
@leoroese Can You Please guide?

@samgohel I guess @leoroese just missed the eslint configuration file for the shared UI directory. On the tutorial You can see that lint-staged just skipped this directory because it does not find any changes related to this path. That's the reason why everything works on his video.
Screenshot 2022-03-25 at 14 32 17

So to fix this issue you have 2 options:

  1. If you do not need to lint your shared UI directory, just remove this part from lint-staged.
  2. If you want to lint your shared UI directory, just add .eslintrc.js configuration file inside the /packages/ui directory. You can copy-paste existing configuration from other projects from /apps/* or create custom one. Then linting should start working and You will need to fix some linting errors but i guess You can do it yourself 👍

P.S I think that's correct solution, i also just started learning about Monorepo/Workspaces stuff, so i'm not an expert 😄

I have fixed the issue on another branch and created a PR for it #9
You can try that and see if it works, it works on my end.