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

import/order: alphabetize doesn't work correctly with group & newlines-between #1561

Closed
inyono opened this issue Dec 9, 2019 · 3 comments · Fixed by #1562
Closed

import/order: alphabetize doesn't work correctly with group & newlines-between #1561

inyono opened this issue Dec 9, 2019 · 3 comments · Fixed by #1562

Comments

@inyono
Copy link

inyono commented Dec 9, 2019

eslint-plugin-import@2.19.1

The following configuration

    'import/order': [
      'error',
      {
        alphabetize: {
          order: 'asc'
        },
        groups: [
          ['builtin', 'external', 'internal'],
          ['parent', 'sibling', 'index', 'unknown']
        ],
        'newlines-between': 'always'
      }
    ],

leads to wrong newlines:

import { StatefulPlugin, string, boolean, object } from '@edtr-io/plugin'

import { createIcon, faCode } from '@edtr-io/ui'

import * as React from 'react'

import { createHighlightEditor } from './editor'

import { HighlightRenderer, HighlightRendererProps } from './renderer'

Deactivating alphabetize leads to correct newlines, i.e. the config

    'import/order': [
      'error',
      {
        alphabetize: {
          order: 'asc'
        },
        groups: [
          ['builtin', 'external', 'internal'],
          ['parent', 'sibling', 'index', 'unknown']
        ],
        'newlines-between': 'always'
      }

leads to

import { StatefulPlugin, string, boolean, object } from '@edtr-io/plugin'
import { createIcon, faCode } from '@edtr-io/ui'
import * as React from 'react'

import { createHighlightEditor } from './editor'
import { HighlightRenderer, HighlightRendererProps } from './renderer'
@ljharb
Copy link
Member

ljharb commented Dec 9, 2019

#1360, #1105, #629, cc @duncanbeevers, @stropho, @luczsoma, @randallreedjr

@mikestopcontinues
Copy link

This bug is still present in 2.19.1. I think this ticket should be reopened.

@ljharb
Copy link
Member

ljharb commented Dec 30, 2019

@mikestopcontinues the fix is merged but unreleased. Issues are closed when fixes are merged, not when the fix is released.

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

Successfully merging a pull request may close this issue.

3 participants