Why (and How Can I FIx) ESLint import/no-extraneous-dependencies Failures on Installed Packages?

Add the following to your eslint, just to have the correct rule in there. And yes you can also turn it off, but the error is there for e reason.

"import/no-extraneous-dependencies": ["error", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}]

As far as I can tell, there is no issue with your package.json, so it has to be a syntax problem.

I don’t have your code so I will show the examples:

var _ = require('lodash');
import _ from 'lodash';

If you have the above code (or something like it)

Then change it to:

import test from 'ava';
import find from 'lodash.find';

You can read more here:

https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)