-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
binary is not in the top level node_modules/.bin
folder after creating an app
#247
Comments
It's weird that npm 3 generates this. Does calling |
yeah, calling |
I think we might have to recommend |
Delightful (nasty) hack I used for this in my entire-ESLint-config-in-a-box package with npm2 - define your own |
Wow much evil. 😄 This is being worked on: eslint/eslint#3458. I think we might expect to have a solution to this in ESLint itself within a couple of months. In the meantime, I documented the complete workaround that involves installing those plugins globally: https://github.com/facebookincubator/create-react-app/blob/master/template/README.md#display-lint-output-in-the-editor. I think it will suffice for now. |
I tested #149 again with
create-react-app my-app --scripts-version 0.2.0-alpha.1
and noticed that ESLint in editor doesn't work as expected. Digging down into the issue and I realized our global-cli andnpm run create-react-app
in the main repo generate different node_module structures (I'm using npm 3):A global
create-react-app my-app
call generates:And
npm run create-react-app my-app
in the main repo generates:As a result, the ESlint in editor part doesn't work for a global cli call. I've only tested my PR using the
npm run create-react-app
script and that's why I thought it was working for me. :(To be clear, this issue only happens before ejecting; after ejecting
eslint
will be moved to the top levelnode_modules/.bin
folder so it works fine. I think there's nothing wrong with"extends": "./node_modules/react-scripts/config/eslint.js"
; the problem is theeslint
binary gets put in a deepnode_modules/.bin
folder so editors (plugins) can't find it.TBH I'm not sure what's a good way to fix this. Could we flatten the
node_module
structure while creating an app?cc @gaearon @vjeux
The text was updated successfully, but these errors were encountered: