Create-react-app: eslint in dependencies rather than dev-dependencies after eject

Created on 28 Sep 2017  路  3Comments  路  Source: facebook/create-react-app

    "eslint": "4.4.1",
    "eslint-config-react-app": "^2.0.1",
    "eslint-loader": "1.9.0",
    "eslint-plugin-flowtype": "2.35.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "5.1.1",
    "eslint-plugin-react": "7.1.0",

Why are these eslint packages in dependencies instead of dev-dependencies after eject? Wouldn't that make the production build size unnecessarily bigger?

question

Most helpful comment

@Timer there's definitely a correct answer, and the technicality of bundling doesn't alter it. Things that are used at runtime - even if via a bundling process - are dependencies, and things that are used to develop the package/app/module, are devDependencies.

Every eslint thing should always be a devDependency; there's literally no reason beyond pedantry to argue otherwise.

All 3 comments

See https://github.com/facebookincubator/create-react-app/issues/2696 for context -- basically there's no correct answer to the argument.
In our opinion, it's nothing to be dogmatic about; if you want to get technical, 100% of your dependencies should be devDependencies, because we produce static files for consumption in production.

Wouldn't that make the production build size unnecessarily bigger?

No, dependencies are not included in your production build unless explicitly imported by your application.

@Timer there's definitely a correct answer, and the technicality of bundling doesn't alter it. Things that are used at runtime - even if via a bundling process - are dependencies, and things that are used to develop the package/app/module, are devDependencies.

Every eslint thing should always be a devDependency; there's literally no reason beyond pedantry to argue otherwise.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oltsa picture oltsa  路  3Comments

wereHamster picture wereHamster  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments