import-js / import-js/eslint-plugin-import

New feature - get error at multiple named import

Open
#1,994 3 comments 0 reactions 0 assignees View on GitHub
help wanted rule proposal
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

For better code split and tree shake, need this to warn/error

```
// WANT THIS
// not ok
import { a, b } from 'package'

// ok
import { a } from 'package/a'
import { b } from 'package/b'
```

but have this (want Inverted(?) group-exports rule)

![Screenshot 2021-02-24 at 18 25 53](https://user-images.githubusercontent.com/427776/109024055-6680f500-76ce-11eb-95d1-1497d01b5ba4.png)

If possible, with regex, to ignore selected packages (like react, storybook, @types, etc)

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests, so first locate the existing rule or entry point that checks grouped imports and review its current behavior. Done should be a warning or error for multiple named imports from one package, while allowing separate subpath imports and configurable package exclusions.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.