Skip to content

Question or Bug Report // parth-sort-order for named imports #14

@HansKre

Description

@HansKre

Hey!

Love this extension! It's amazing and saving me tons of my time! Thank you so much for making it!

I have observed following behavior for named imports and wanted to check if this is how it is supposed to be:

Observed behavior

import React from 'react';
import { DialogContent } from '../DialogContent';
import { Label } from '../Label';
import { Slugs } from '../Slugs';
import {
  Details,
  ToolReference,
} from '@my-package/components;

Expected behavior

For me, following sort-order would make much more sense:

import React from 'react';
import {
  Details,
  ToolReference,
} from '@my-package/components;
import { DialogContent } from '../DialogContent';
import { Label } from '../Label';
import { Slugs } from '../Slugs';

Please let me know your opinion. Would be happy to contribute myself. Just wanted to align with you upfront.

My config

"typescript.extension.sortImports.sortMethod": "path",
  "typescript.extension.sortImports.pathSortOrder": [
    "package",
    "relativeUpLevel",
    "relativeDownLevel"
  ],
  "typescript.extension.sortImports.sortOnSave": true,
  "typescript.extension.sortImports.pathSortOrderOverride": ["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