import-js/eslint-plugin-import

Alias definition in Babel module resolver causes no-relative-parent-imports since v2.15.0

Open

#1,299 opened on Mar 11, 2019

View on GitHub
 (10 comments) (2 reactions) (0 assignees)JavaScript (4,946 stars) (1,540 forks)batch import
help wanted

Description

Since eslint-plugin-import 2.15.0 the following Eslint configuration

settings: {
    'import/resolver': {
      'babel-module': {
        cwd: __dirname,
        alias: {
          $shared: '../shared',
          '~': '.'
        }
      }
    }
  }

causes

  ×   8:38  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move cli.js to same directory as $shared/kiosk-ui-message-file-reader or consider making $shared/kiosk-ui-message-file-reader a package.    import/no-relative-parent-imports

Is this new behavior intended?

Contributor guide