import-js/eslint-plugin-import

Linter mistakenly assumes global module is a parent directory of the project

オープン

#1,291 opened on 2019/02/19

 (3 件のコメント) (5 件のリアクション) (0 人の担当者)JavaScript (1,549 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (5,939 個のスター)
PR merge metrics
 (平均マージ 138d 22h) (30d で 3 merged PRs)

説明

I have code doing an import like:

import {all} from 'redux-saga/effects';
import {REHYDRATE} from 'redux-persist/constants';

Producing the linter errors below:

1:25  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `session.js` to same directory as `redux-persist/constants` or consider making `redux-persist/constants` a package  import/no-relative-parent-imports

11:8  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `index.js` to same directory as `redux-saga/effects` or consider making `redux-saga/effects` a package  import/no-relative-parent-imports

Clearly the suggested resolution in the error doesn't make sense but I'm not sure why it thinks this should be the case. #793 has some similarities but I'm not sure if those are superficial or real.

コントリビューターガイド