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/named works fail with destructuring with default values #718

Closed
bigslycat opened this issue Jan 11, 2017 · 2 comments · Fixed by #1232
Closed

import/named works fail with destructuring with default values #718

bigslycat opened this issue Jan 11, 2017 · 2 comments · Fixed by #1232

Comments

@bigslycat
Copy link

bigslycat commented Jan 11, 2017

env.js:

...

export const {
  ENTRY = rc.entry || './index.js',

  PATH = rc.path || resolve('dist'),
  PUBLIC = rc.publicPath || '/',
  FILENAME = rc.filename || 'bundle.js',
  NODE_ENV = 'development',
} = process.env;

other.js:

2017-01-11 14-46-58

All works correctly without default values.

@bigslycat bigslycat changed the title import/named worrks fail with destructuring with default values import/named works fail with destructuring with default values Jan 11, 2017
@ljharb
Copy link
Member

ljharb commented Jan 11, 2017

can you provide the errors as reported on the command line?

@vikr01
Copy link
Contributor

vikr01 commented Nov 15, 2018

Running into the same issue:

// exported.js
export const {
  foo: bar = 'baz',
} = {};

// imported.js
import {bar} from './exported';
// error  bar not found in './export'  import/named

cjolowicz added a commit to cjolowicz/muckr-web that referenced this issue Jan 2, 2019
We need to disable the `import/named` eslint rule when importing, to
work around #718 in eslint-plugin-import.

import-js/eslint-plugin-import#718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants