-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[New] order
: add orderByFullPathString
option
#3196
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3196 +/- ##
==========================================
- Coverage 82.25% 0.00% -82.26%
==========================================
Files 94 94
Lines 4283 4262 -21
Branches 1478 1427 -51
==========================================
- Hits 3523 0 -3523
- Misses 760 4262 +3502 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's some uncovered lines, so we'll need some more test cases.
order
: add orderByFullPathString
option
docs/rules/order.md
Outdated
@@ -385,6 +385,8 @@ Valid properties and their values include: | |||
|
|||
- **`caseInsensitive`**: use `true` to ignore case and `false` to consider case when sorting | |||
|
|||
- **`orderByFullPathString`**: use `false` to split by paths and sort by each one and `true` to sort by the full un-split path string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a better way to phrase this?
like, perhaps one way sorts the way certain operating systems and IDEs do, and the other sorts the way other ones do? (with an example list of each)
docs/rules/order.md
Outdated
@@ -385,6 +385,9 @@ Valid properties and their values include: | |||
|
|||
- **`caseInsensitive`**: use `true` to ignore case and `false` to consider case when sorting | |||
|
|||
- **`orderByFullPathString`**: use `true` to sort by the full un-split path string and `false` to split by paths and sort by each one | |||
- enabling this flag may better align with the sort algorithm used by certain operating systems and IDE's, e.g. the Organize Imports action in JetBrains IDE's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to ask for more work, but i'd love some research on lists for both of the options :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally I'm only aware of the impact to Organize Imports in WebStorm b/c that is what has affected me and my team
not sure how i would find other impacted examples
i know that other people have taken note of this difference: #2722
apparently this has had an effect on Microsoft's accessibility-insights-web
tool
microsoft/accessibility-insights-web#6846
should i add that to the markup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be great!
How does your local OS sort these things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a video demo of the Organize Imports behavior in WebStorm IDE:
org-imports-demo-video.mp4
Ideally Jetbrains would make the sort algorithm for Organize Imports configurable from their end, but unfortunately that isn't currently possible.
So without a change in this plugin my team will either need to:
- Stay on version 2.26 of this plugin, or
- Always sort according to Eslint and no longer use the action in WebStorm, or
- Choose a different/simpler import plugin that "vibes" with WebStorm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that makes sense :-)
I meant, in Mac and Windows, say, if you name a bunch of empty files as the specifier names, how does it sort them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that's perfect! I believe Mac works the same way.
No description provided.