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

Enable rule sort-imports for members #81

Closed
wants to merge 1 commit into from
Closed

Enable rule sort-imports for members #81

wants to merge 1 commit into from

Conversation

remcohaszing
Copy link
Contributor

There is no reason to not sort import members.

This is just an idea. Feel free to close if you disagree. :)

There is no reason to not sort import members.
@sindresorhus
Copy link
Member

Thanks for the suggestion, but this is not something I want. I personally, see no reason to sort them like this.

I prefer https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md, which I do use in XO.

@remcohaszing
Copy link
Contributor Author

I agree import/order is more powerful for sorting import declarations, but it doesn’t support sorting members.

To be clear, import/order would complain here, because lodash should come after node:path:

import 'lodash'
import 'node:path'

sort-imports complains here, because resolve should come after join:

import { resolve, join } from 'node:path'

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

Successfully merging this pull request may close these issues.

None yet

2 participants