Skip to content

Type sorting does not work correctly #54

Open
@serGlazkov

Description

@serGlazkov

The section with type imports looks wrong
My config is:

'import-helpers/order-imports': [
  'error',
  {
    newlinesBetween: 'always', // new line between groups
    groups: [
      ['/^react$/', '/^next/', 'module'],
      ['/^@framework/', '/^@lib/'],
      '/^@contexts/',
      '/^@components/',
      ['parent', 'sibling', 'index'],
      'type',
    ],
    alphabetize: { order: 'asc', ignoreCase: true },
  },
],

The sorting result looks like this:

import { AnimatePresence, motion } from 'framer-motion'
import { useTranslation } from 'next-i18next'
import Link from 'next/link'
import { useToggle } from 'react-use'

import {
  useTrackIdentifyCustomer,
  useTrackLogin,
  useTrackRegistration,
} from '@lib/tracking/helper'

import { useAuthContext } from '@contexts/AuthContext/AuthContext'

import { Button, Logo } from '@components/ui'

import { AuthFormInput } from './AuthFormInput'
import { getFormData } from './get-form-data'
import { hasErrors } from './has-errors'

import type { AuthFormData, AuthFormErrors } from './useFormValidation'
import { useFormValidation } from './useFormValidation'
import { useCallback, useEffect, useState } from 'react'
import type { FC, FormEvent, HTMLAttributes } from 'react'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions