Gatsby: Yarn workspace root eslint?

Created on 22 Jun 2018  路  8Comments  路  Source: gatsbyjs/gatsby

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!

question or discussion

Most helpful comment

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!

All 8 comments

/cc @kkemple

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!

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

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!

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

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!

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?

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magicly picture magicly  路  3Comments

signalwerk picture signalwerk  路  3Comments

rossPatton picture rossPatton  路  3Comments

ferMartz picture ferMartz  路  3Comments

kalinchernev picture kalinchernev  路  3Comments