Gatsby: Some gatsby package dependencies should be devDependencies

Created on 23 Jan 2020  路  7Comments  路  Source: gatsbyjs/gatsby

Description

Migrate some dependencies in devDependencies for gatsby package.

At least these (non exhaustive):

  • "@typescript-eslint/eslint-plugin"
  • "@typescript-eslint/parser"
  • "eslint"
  • "eslint-config-react-app"
  • "eslint-loader"
  • "eslint-plugin-flowtype"
  • "eslint-plugin-graphql"
  • "eslint-plugin-import"
  • "eslint-plugin-jsx-a11y"
  • "eslint-plugin-react"
  • "eslint-plugin-react-hooks"

Steps to reproduce

yarn install --production
npm install --production

Expected result

No dev packages should be installed.

Actual result

Load linting dependencies and others

Environment

All.

good first issue maintenance

Most helpful comment

I can take this.

All 7 comments

"eslint"
"eslint-config-react-app"
"eslint-loader"
"eslint-plugin-graphql"
"eslint-plugin-import"
"eslint-plugin-jsx-a11y"
"eslint-plugin-react"
"eslint-plugin-react-hooks"

These are correctly set to dependencies because they're used when running gatsby develop (Gatsby lints your site's code)

"eslint-plugin-flowtype"
"@typescript-eslint/eslint-plugin"
"@typescript-eslint/parser"

These on the other hand _are_ indeed devDependencies and could be moved there.

I can take this.

Flow and TypeScript packages should even be optionalDependencies.

Hmm, after some thinking I just realised that these shouldn't be dependencies of gatsby but in our monorepo root package.json since they're used when developing gatsby (and not a gatsby site)

Flow and TypeScript packages should even be optionalDependencies.

Hmm, after some thinking I just realised that these shouldn't be dependencies of gatsby but in our monorepo root package.json since they're used when developing gatsby (and not a gatsby site)

Just to make sure I understand, I can remove all dependencies related to typescript and flow from /packages/gatsby?

So for example, I can ditch eslint-plugin-flowtype.

@sidharthachatterjee @pieh I'm following up because I'm losing the thread a bit here between the issue and the PR.

Would one of you let me know what you'd like?

cc @sidharthachatterjee @pieh

Can't remove those deps or move to dev deps because of https://github.com/gatsbyjs/gatsby/issues/20815#issuecomment-577703587 - the additional 3 deps there are peer deps of eslint-config-react-app so they also need to stay

Was this page helpful?
0 / 5 - 0 ratings