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

Request: the "no-duplicates" rule should support the 'declaration' style when importing flow types

Open
#1,241 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

flow help wanted
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

The "no-duplicates" correctly distinguishes Flow type imports from standard imports.

import {myClass} from './mod'
import type {myType} from './mod'

When using the 'declaration' style this is no longer possible:

import {myClass} from './mod'
import {type myType} from './mod'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the no-duplicates rule and its existing tests, then trace how Flow type imports are distinguished from standard imports. Reproduce the two shown import styles and compare current results; done means the declaration-style example is handled consistently without regressing the existing import-style case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.