Eslint-plugin-import: BUG? import/no-extraneous-dependencies react

Created on 15 Mar 2019  路  3Comments  路  Source: benmosher/eslint-plugin-import

eslint tip is:
error 'react' should be listed in the project's dependencies. Run 'npm i -S react' to add it import/no-extraneous-dependencies error 'react-dom' should be listed in the project's dependencies. Run 'npm i -S react-dom' to add it import/no-extraneous-dependencies

bug react and react-dom is in my package.json
my version is [email protected]

Most helpful comment

What file is erroring? What syntax is in the file? Is react and react-dom in _dependencies_, or in devDeps?

Hi thanks for your reply

react and react-dom are in dependencies and my code file is:
import React from 'react'; import dom from 'react-dom';

I resolve this problem after upgrading to version 2.16.0
and, adding this configuration:
"import/no-extraneous-dependencies": [ "error", { "packageDir": "./" } ]

All 3 comments

What file is erroring? What syntax is in the file? Is react and react-dom in dependencies, or in devDeps?

Possible duplicate of #1289.

What file is erroring? What syntax is in the file? Is react and react-dom in _dependencies_, or in devDeps?

Hi thanks for your reply

react and react-dom are in dependencies and my code file is:
import React from 'react'; import dom from 'react-dom';

I resolve this problem after upgrading to version 2.16.0
and, adding this configuration:
"import/no-extraneous-dependencies": [ "error", { "packageDir": "./" } ]

Was this page helpful?
0 / 5 - 0 ratings