Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports of the same package is not combined #1

Closed
Zhuvikin opened this issue Dec 2, 2018 · 2 comments
Closed

Imports of the same package is not combined #1

Zhuvikin opened this issue Dec 2, 2018 · 2 comments

Comments

@Zhuvikin
Copy link

Zhuvikin commented Dec 2, 2018

Imports of the same package are to be combined to the one import.


Steps to reproduce:

Try to fix the following

import React from 'react'
import { Component } from 'react'

Actual result:

import React from 'react'
import { Component } from 'react'

Expected result:

import React, { Component } from 'react'

Steps to reproduce:

Try to fix the following

import './styles.scss'
import './styles.scss'

Actual result:

import './styles.scss'
import './styles.scss'

Expected result:

import './styles.scss'
@lydell
Copy link
Owner

lydell commented Jan 26, 2019

Hi! Thanks for the issue!

I thought about this too a while ago, but I came to the conclusion that it is better to use import/no-duplicates. It does not support autofix, but I don’t see why that couldn’t be added to it.

What do you think?

@lydell lydell changed the title Imports from the same package is not combined Imports of the same package is not combined Jan 26, 2019
@lydell
Copy link
Owner

lydell commented Mar 30, 2019

Autofix PR for no-duplicates: import-js/eslint-plugin-import#1312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants