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

v2.23 causes no-extraneous-dependencies errors for related @types/ packages that aren't imported #2078

Closed
neefrehman opened this issue May 15, 2021 · 8 comments · Fixed by #2097

Comments

@neefrehman
Copy link

Since upgrading to v2.23 I'm seeing lot's of errors in my TypeScript codebase related to @types dependencies, even though they are not directly being imported. for example:

import React from "react";
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";

Is throwing:

  3:1  error  '@types/react' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies
  4:1  error  '@types/three' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies
  5:1  error  '@types/three' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies
@neefrehman neefrehman changed the title v2.23 causes no-extraneous-dependencies errors for @types/ devDependencies v2.23 causes no-extraneous-dependencies errors for related @types/ packages that aren't imported May 15, 2021
@marjorg
Copy link

marjorg commented May 15, 2021

Can confirm this. Reverting to 2.22.1 for now

@buu700
Copy link

buu700 commented May 15, 2021

Possibly related issue: I'm now getting error 'rxjs/operators' should be listed in the project's dependencies. Run 'npm i -S rxjs/operators' to add it import/no-extraneous-dependencies, with rxjs/operators being a path within the rxjs package.

@ljharb
Copy link
Member

ljharb commented May 15, 2021

I believe this may be a duplicate of #2065, and possibly related to #2058.

@JuanpaG94
Copy link

JuanpaG94 commented May 18, 2021

Can confirm this. Not only for @types/ dependencies but everything that has other packages inside the dependency.
For example styled-components/native or similar.

Possible workarounds are:

  1. Reverting to 2.22.1 for now
  2. Adding 'import/no-extraneous-dependencies': 'off' to your eslint rules

@sachinraja
Copy link

sachinraja commented May 21, 2021

Thanks for reporting this! I thought I was going crazy 😆. For me, @types dependencies are erroring, specifically @types/react ( '@types/react' should be listed in the project's dependencies, not devDependencies). and @types/yup ('@types/yup' should be listed in the project's dependencies. Run 'npm i -S @types/yup' to add it). Downgrading to 2.22.1 fixed both of these.

@mtnowl
Copy link

mtnowl commented May 27, 2021

Is this addressed by #2097?

@VirajKanse
Copy link

is this fixed yet or not?
Am still facing same issue for @chakra-ui/layout & other components

@ljharb
Copy link
Member

ljharb commented Jun 20, 2021

Yes, it’s fixed in v2.23.4. If you’re still seeing it, please file a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

8 participants