Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Implement new rule no-duplicate-imports #3075

Merged
merged 1 commit into from
Jul 27, 2017
Merged

Implement new rule no-duplicate-imports #3075

merged 1 commit into from
Jul 27, 2017

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Jul 25, 2017

PR checklist

Overview of change:

[new-rule] no-duplicate-imports
Fixes: #2869

Is there anything you'd like reviewers to focus on?

Some thoughts about the current implemenation:

  • There no option includeExports like in the ESLint rule. Do we want this?
  • ImportEqualsDeclarations are ignored
  • There's no fixer. That can be added later.
  • In some cases you cannot simply merge imports. The rule will still complain about them (maybe the error message should be changed?):
import foo from 'foo';
import foo2 from 'foo'; // cannot be combined with preceding import

import * as bar from 'bar';
import {baz} from 'bar'; // cannot be combined with preceding import

CHANGELOG.md entry:

[new-rule] `no-duplicate-imports`
Fixes: #2869
@adidahiya
Copy link
Contributor

In some cases you cannot simply merge imports. The rule will still complain about them (maybe the error message should be changed?)

👍 for still complaining about them. same error message is fine for now

@ajafff ajafff merged commit f26d3a5 into palantir:master Jul 27, 2017
@ajafff ajafff deleted the duplicate-imports branch July 27, 2017 18:26
HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this pull request Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New rule: no-duplicate-imports
2 participants