question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move eslint dep to peerDeps or remove it

See original GitHub issue

Hey, Putting eslint to the dependencies can cause issues (like for me, I’m trying to use eslint 4.9.0 but prettier-eslint interferes)

"prettier-eslint": {
      "version": "8.2.0",
      "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-8.2.0.tgz",
      "integrity": "sha512-OSx/0ULxWuIjeMO6KJoMVIDc7/Kj9a0wxUDzaGJTNiZXlNRq2bCl5jya8p42OQCVJzp1HnnQyGrWb+6/5+jbJQ==",
      "dev": true,
      "requires": {
        "common-tags": "1.4.0",
        "dlv": "1.1.0",
        "eslint": "4.8.0",
        "indent-string": "3.2.0",
        "lodash.merge": "4.6.0",
        "loglevel-colored-level-prefix": "1.0.0",
        "prettier": "1.7.3",
        "pretty-format": "20.0.3",
        "require-relative": "0.8.7",
        "typescript": "2.5.3",
        "typescript-eslint-parser": "7.0.0"
      },
      "dependencies": {
        "indent-string": {
          "version": "3.2.0",
          "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
          "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
          "dev": true
        },
        "lodash.merge": {
          "version": "4.6.0",
          "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz",
          "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=",
          "dev": true
        }
      }
    }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mxmzbcommented, Jul 10, 2018

@zimme i will give it a shot: i just migrated a bunch of projects into a monorepo. one of these projects happens to be a create-react-app which comes with its own version of eslint. configuring anything at this point in CRA would require me to eject (or turn off the preflight check).

now when i wanted to move up all my dev dependencies from my projects that are used multiple times across the monorepo, i can’t bring up prettier-eslint, because it will also install a newer version of eslint in my root node_modules and interfere with the CRA project.

tldr: moving eslint to peer dependencies could help working with mono repos (which i feel are increasingly receiving attention currently) but state no real disadvantages, besides of that devs need to have eslint declared explicitly in their package.json (which is also good practice imho and stimulates the understanding of devs who don’t understand their package.json yet).

0reactions
aMarCruzcommented, Feb 14, 2019

yes, there’s issues with CRA

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should I duplicate "peerDependencies" in "dependencies ...
No assume that I forked the @typescript-eslint/eslint-plugin and want all ERR! messages mentioned in question disappear.
Read more >
A Guide to ESLint | Laurie on Tech
For example, ESLint has a rule called import/no-extraneous-dependencies . The goal of this rule is to catch situations in which you've imported ...
Read more >
Reduce maintenance effort with shared ESLint and Prettier ...
The Prettier package demonstrates moving adjustments of the default setup into a shared library (in our case, we change the default double ...
Read more >
Shareable Configs - ESLint - Pluggable JavaScript Linter
... your dependency on ESLint in package.json using the peerDependencies field. ... shareable config, you can specify these packages as dependencies .
Read more >
eslint-config-react-app-with-peer-deps - npm package | Snyk
eslint -config-react-app-with-peer-deps. v5.2.1. ESLint configuration used by Create React App, including its peer dependencies, but als ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found