trivago / prettier-plugin-sort-imports

A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order.
Apache License 2.0
3.4k stars 135 forks source link

Import classnames moved to down for no reason #317

Open krutoo opened 1 week ago

krutoo commented 1 week ago

Hi, my config and order is:

{

  "plugins": ["@trivago/prettier-plugin-sort-imports"],
  "importOrderSortSpecifiers": true,
  "importOrder": [
    "<THIRD_PARTY_MODULES>",
    "^#.+$",
    "^\\.\\./.+$",
    "^\\./.+$",
    "^classnames",
    "\\.css$"
  ]
}

And my imports in file after running prettier is:

import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes } from 'react';
import ArrowSVG from '#icons/arrow.svg';
import styles from './button.m.css';
import classNames from 'classnames'; // why classNames is last?

I dont understand why my classNames import line is last

Can someone help? Maybe i write wrong regex?