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

import/order fails after updating a dependency (redux-saga) #793

Closed
mastilver opened this issue Apr 6, 2017 · 5 comments · Fixed by #794
Closed

import/order fails after updating a dependency (redux-saga) #793

mastilver opened this issue Apr 6, 2017 · 5 comments · Fixed by #794

Comments

@mastilver
Copy link
Contributor

When using redux-saga@0.14.4 everything is fine
But fails when using redux-saga@0.14.5

I think the reason for this to fails is this PR: redux-saga/redux-saga#895


Error message:

./userSaga import should occur before import of redux-saga/effects import/order

Code:

import { fork } from 'redux-saga/effects';

import connectionFlow from './userSaga';
@vadimdemedes
Copy link

I can confirm this issue is happening to me as well. redux-saga removed the redux-saga/effects.js file, so it freaks out eslint-plugin-import.

@ephys
Copy link
Contributor

ephys commented Apr 6, 2017

It's probably due to the fact that redux-saga/effects.js was replaced with a package.json file with a relative path as a main field ? (naive guess, currently looking into it).

Edit:
It's because importType.isExternalPath is trying to find
node_modules/redux-saga/effects
Inside the resolved path which actually is
<project_path>/node_modules/redux-saga/es/effects.js
to correctly mark is as an external module

Working on a fix.

ephys added a commit to ephys/eslint-plugin-import that referenced this issue Apr 6, 2017
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Apr 6, 2017
@jch254
Copy link

jch254 commented Apr 20, 2017

Any update on this one? Cheers

@lourd
Copy link

lourd commented May 9, 2017

Also facing this issue. To add, it's peculiar that the linter reports this as a warning from the import/order plugin, but my editor integration reports it (more appropriately?) as "Unable to resolve path to module 'redux-saga/effects'. (import/no-unresolved). This appears to compound the original issue because it's not possible to workaround the warning while the fix is resolved by simply disabling eslint on the line of the redux-saga/effects import

import { put, call, takeEvery } from 'redux-saga/effects'; // eslint-disable-line  <- doesn't help

It still causes warnings for other imports in the file, namely from import/order.

tofumatt added a commit to mozilla/addons-frontend that referenced this issue Jul 10, 2017
tofumatt added a commit to mozilla/addons-frontend that referenced this issue Jul 10, 2017
tofumatt added a commit to mozilla/addons-frontend that referenced this issue Jul 10, 2017
tofumatt added a commit to mozilla/addons-frontend that referenced this issue Jul 10, 2017
tofumatt added a commit to mozilla/addons-frontend that referenced this issue Jul 10, 2017
@artsafin
Copy link

As a temporary workaround, one can add redux-saga/effects to import/core-modules.
That will make it at least higher that internal modules in the imports list.

Example:

    settings: {
        'import/core-modules': [
            'redux-saga/effects',
        ]
    },

tofumatt added a commit to mozilla/addons-frontend that referenced this issue Jul 10, 2017
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Sep 15, 2017
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Sep 15, 2017
ljharb pushed a commit to ephys/eslint-plugin-import that referenced this issue Jan 5, 2018
ljharb pushed a commit to ephys/eslint-plugin-import that referenced this issue Jan 5, 2018
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Jul 25, 2018
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Jul 25, 2018
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Aug 24, 2018
ephys added a commit to ephys/eslint-plugin-import that referenced this issue Aug 24, 2018
ljharb pushed a commit to ephys/eslint-plugin-import that referenced this issue Mar 3, 2019
ljharb pushed a commit to ephys/eslint-plugin-import that referenced this issue Mar 3, 2019
ljharb pushed a commit to ephys/eslint-plugin-import that referenced this issue Mar 3, 2019
…ernal modules

Fixes import-js#793.

 - Add skipped test to expect scoped internal packages to be "internal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment