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

eslint-plugin-react-hooks v2.0.0 is not loaded correctly. #16531

Closed
ykzts opened this issue Aug 21, 2019 · 3 comments
Closed

eslint-plugin-react-hooks v2.0.0 is not loaded correctly. #16531

ykzts opened this issue Aug 21, 2019 · 3 comments

Comments

@ykzts
Copy link

ykzts commented Aug 21, 2019

Do you want to request a feature or report a bug?

Bug (maybe)

What is the current behavior?

eslint-plugin-react-hooks is not loaded correctly.

eslint-plugin-react-hooks@2.0.0/index.js is not the correct file. packages/eslint-plugin-react-hooks/npm/index.js should be used.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

$ cd $(mktemp -d)
$ yarn add -D eslint eslint-plugin-react-hooks
$ touch test.js
$ yarn eslint --plugin react-hooks test.js
yarn run v1.17.3
warning package.json: No license field
$ /tmp/tmp.nAQkiU0etB/node_modules/.bin/eslint --plugin react-hooks test.js
Error: Failed to load plugin 'react-hooks' declared in 'CLIOptions': Cannot find module './src/index'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (/tmp/tmp.nAQkiU0etB/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/tmp/tmp.nAQkiU0etB/node_modules/eslint-plugin-react-hooks/index.js:10:18)
    at Module._compile (/tmp/tmp.nAQkiU0etB/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What is the expected behavior?

Plugin is loaded successfully.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

only eslint-plugin-react-hooks@2.0.0

@thiagobrez
Copy link

Same issue here. Only on eslint-plugin-react-hooks@2.0.0

@jamesmosier
Copy link

Upon inspecting the eslint-plugin-react-hooks (v2.0.0) folder installed (in node_modules), the src folder is missing. index.js expects to be able to import ./src/index.

Screen Shot 2019-08-21 at 3 31 53 PM

@gaearon
Copy link
Collaborator

gaearon commented Aug 21, 2019

Oops. I published from a wrong folder. The fix is out in 2.0.1.

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

No branches or pull requests

4 participants