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

Feature request: object group alphabetize sort #2923

Open
tlserver opened this issue Nov 16, 2023 · 3 comments
Open

Feature request: object group alphabetize sort #2923

tlserver opened this issue Nov 16, 2023 · 3 comments

Comments

@tlserver
Copy link

import FieldValue = admin.firestore.FieldValue;
import Timestamp = admin.firestore.Timestamp;
import DocumentReference = admin.firestore.DocumentReference;

It seem that sorting object group is not possible in current version. I am using this rule option.

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

In doc, alphabetize option:

Sort the order within each group in alphabetical manner based on import path:

But object import have no import path. I think it is nice to have one more option to sort object group by variable name.

@JounQin
Copy link
Collaborator

JounQin commented Nov 16, 2023

What's this syntax? I don't recognize it.

@tlserver
Copy link
Author

tlserver commented Nov 16, 2023

This is same kind of

// 7. "object"-imports (only available in TypeScript)
import log = console.log;

in order document.

@ljharb
Copy link
Member

ljharb commented Nov 18, 2023

While nobody should be using TypeScript's bizarre import = syntax - when you enable esModuleInterop and synthetic imports, so that TS's module system isn't broken, there's no point to it - I agree that "object" should ideally cover it. That said, it may not be worth the effort since there's no reason to use that syntax.

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

No branches or pull requests

3 participants