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

Yarn workspace root eslint? #6080

Closed
VictorChen opened this issue Jun 21, 2018 · 8 comments
Closed

Yarn workspace root eslint? #6080

VictorChen opened this issue Jun 21, 2018 · 8 comments
Assignees
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@VictorChen
Copy link

Hi, I've looked everywhere but couldn't find a solution to this... I have a monorepo with yarn workspace, eg:

root
  => packages
    => A (gatsby site)
    => B
    => C
  => .eslintrc

Is there a way I can tell gatsby to use the .eslintrc file in the root of the repo? I currently have B and C set up to use my .eslintrc file, but not for A (gatsby site)

I'm on the latest version of gatsby (2.0.0-beta.9). Thanks!

@KyleAMathews
Copy link
Contributor

/cc @kkemple

@kkemple
Copy link
Contributor

kkemple commented Jun 21, 2018

Gatsby currently looks in the working directory for eslint config and disables the gatsby linting if found. Since you're in a monorepo right now you would need to copy your eslint config over to the gatsby site folder.

We could look at options for disabling in another fashion (environment variable or something) but without really good documentation that may be equally as troublesome.

We will be making the integration of tooling (jest/eslint) much easier in the near future but that is still be worked out!

@KyleAMathews
Copy link
Contributor

We could recursively look up for an eslint config too? Is there a eslint config loader helper that does this?

@jquense
Copy link
Contributor

jquense commented Jun 22, 2018

I recently got around this by sticking an eslintrc in the Gatsby root and have it extend then higher up one. Nicer and simple workaround!

@m-allanson m-allanson added the type: question or discussion Issue discussing or asking a question about Gatsby label Jun 22, 2018
@kkemple
Copy link
Contributor

kkemple commented Jun 22, 2018

We could recursively look up for an eslint config too? Is there a eslint config loader helper that does this?

@KyleAMathews I'll look into it today

@KyleAMathews KyleAMathews added this to To Do - v2 in Gatsby v2 Release via automation Jun 28, 2018
@kkemple
Copy link
Contributor

kkemple commented Jun 28, 2018

Until we can get better recursive checking (which brings about a new set of issues) you can use the method mentioned by @jquense above

I recently got around this by sticking an eslintrc in the Gatsby root and have it extend then higher up one. Nicer and simple workaround!

@VictorChen
Copy link
Author

thanks @kkemple, maybe I'm missing something... but seems like having a eslintrc file will disable linting? How can I keep linting but have it use my own eslint rules?

@pieh pieh moved this from To Do - v2 to non-blocking but would be great to have in Gatsby v2 Release Jul 18, 2018
@KyleAMathews
Copy link
Contributor

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Gatsby v2 Release automation moved this from non-blocking but would be great to have to Done Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
No open projects
Development

No branches or pull requests

5 participants