import-js/eslint-plugin-import

Check for importing named exports from CJS module

Open

#928 opened on Sep 15, 2017

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

Description

With the new node.js 8.5 ESM support importing CJS modules as if they had named exports is not supported. (Unlike Babel)

Eg:

// bad
import { get } from 'lodash';

//good
import _ from 'lodash';
const get = _.get;

//good
import { get } from 'lodash-es';

Contributor guide