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.

[import/no-extraneous-dependencies] Problems when only using types

See original GitHub issue

We’ve started to see failures when moving from 2.18.2 to 2.20.0 regarding importing only types from devDependencies in TypeScript source code. Previously the rule wasn’t triggering for these (which I would expect), but it now is.

Refs https://github.com/libero/article-store/pull/174.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:41 (21 by maintainers)

github_iconTop GitHub Comments

11reactions
filipsukcommented, Apr 20, 2020

Is there a way to suppress this error when using new TS syntax import type ...? Or any other workaround apart from naming all the modules in import/internal-regex?

import type { APIGatewayEvent, APIGatewayEventRequestContext } from 'aws-lambda';

causes ESLint: 'aws-lambda' should be listed in the project's dependencies. Run 'npm i -S aws-lambda' to add it(import/no-extraneous-dependencies)

in my devDependencies

"@types/aws-lambda": "8.10.40",
4reactions
fernandopasikcommented, Jun 12, 2020

Created the PR and added tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why (and How Can I FIx) ESLint import/no-extraneous ...
As far as I can tell, there is no issue with your package.json, ... 'Definition for rule 'import/no-extraneous-dependencies' was not found'.
Read more >
A Guide to ESLint | Laurie on Tech
While this is helpful, some rules need to get more specific. For example, ESLint has a rule called import/no-extraneous-dependencies . The goal ...
Read more >
eslint/eslint - Gitter
Having some weird path issues with eslint. Robert Main. @rmainseas ... Run 'npm i -S assert' to add it import/no-extraneous-dependencies. Roy Sutton.
Read more >
eslint-plugin-import - npm
Start using eslint-plugin-import in your project by running `npm i ... Forbid the use of extraneous packages ( no-extraneous-dependencies ) ...
Read more >
Vite and @vitejs/plugin-vue as devDependencies - Reddit
'vite' should be listed in the project's dependencies, not devDependencies. This is the ESlint error type: eslint-plugin-import/no-extraneous- ...
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