import-js / import-js/eslint-plugin-import
Check for importing named exports from CJS module
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
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:
```js
// bad
import { get } from 'lodash';
//good
import _ from 'lodash';
const get = _.get;
//good
import { get } from 'lodash-es';
```
Contributor guide
Research direction
The issue provides JavaScript import examples and names Node.js 8.5, CommonJS, ESM, Babel, lodash, and lodash-es, but no repository file or test. Start by locating the existing rule or tests for named imports from CommonJS modules. Done means the lodash-style import is flagged while default-import property access and named imports from lodash-es remain allowed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100