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.

The `imports` in tests for the rule `import/no-extraneous-dependencies`

See original GitHub issue

Some of the dependencies in test code are in devDependencies. When I lint the test code, some errors appear:

  1:1  error  'chai' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies

This error is unexpected.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
ljharbcommented, Jul 21, 2016

@Alex1990 the default is for the entire project, which is to only allow dependencies. The proper solution is to make a .eslintrc in your “test” folder, that overrides the rule to allow devDependencies also.

2reactions
ljharbcommented, Sep 15, 2016

Yes, take a look at who filed the issue requesting it :-p https://github.com/benmosher/eslint-plugin-import/issues/470

This will be released as an update soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eslint allow extraneous dependencies in tests - Stack Overflow
Why am I getting "Definition for rule 'import/no-extraneous-dependencies' was not found" when running ESLint? 1 · ESLint configuration in .
Read more >
node_modules/eslint-plugin-import/docs/rules/no-extraneous ...
import/no-extraneous-dependencies: Forbid the use of extraneous packages. Forbid the import of external modules that are not declared in the ...
Read more >
A Guide to ESLint | Laurie on Tech
ESLint allows you to set project-level rules using an .eslintrc file. ... ESLint has a rule called import/no-extraneous-dependencies .
Read more >
eslint-config-airbnb-base | Yarn - Package Manager
[minor] add new disabled rules, update eslint · [minor] enable import/no-useless-path-segments for commonjs (#2113) · [fix] whitespace : only set erroring rules ......
Read more >
Import Regulations - International Trade Administration
Almost all countries require documentation for imported products and have ... In many cases, U.S. exporters will face additional regulations, testing, ...
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