You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/order.md
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -385,7 +385,8 @@ Valid properties and their values include:
385
385
386
386
-**`caseInsensitive`**: use `true` to ignore case and `false` to consider case when sorting
387
387
388
-
-**`orderByFullPathString`**: use `false` to split by paths and sort by each one and `true` to sort by the full un-split path string
388
+
-**`orderByFullPathString`**: use `true` to sort by the full un-split path string and `false` to split by paths and sort by each one
389
+
- 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
389
390
390
391
#### Example
391
392
@@ -396,7 +397,8 @@ Given the following settings:
396
397
"import/order": ["error", {
397
398
"alphabetize": {
398
399
"order":"asc",
399
-
"caseInsensitive":true
400
+
"caseInsensitive":true,
401
+
"orderByFullPathString":true,
400
402
}
401
403
}]
402
404
}
@@ -410,6 +412,8 @@ import aTypes from 'prop-types';
410
412
import { compose, apply } from'xcompose';
411
413
import*asclassnamesfrom'classnames';
412
414
importblistfrom'BList';
415
+
importtimeUtils1from'../utils/time'
416
+
importtimeUtils2from'../utils-time'
413
417
```
414
418
415
419
While this will pass:
@@ -420,6 +424,11 @@ import * as classnames from 'classnames';
420
424
importaTypesfrom'prop-types';
421
425
importReact, { PureComponent } from'react';
422
426
import { compose, apply } from'xcompose';
427
+
// Below the '../utils-time' and '../utils/time' path are not split before ordering ("orderByFullPathString": true).
428
+
// Instead, during comparison the "-" in "../utils-time" occurs lexicographically before the
0 commit comments