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
|`group`| ☑️ |[predefined group][18]| One of the [predefined groups][18] to which matching imports will be positioned relatively |
199
-
|`position`||`"after" \| "before"`| Where, in relation to `group`, matching imports will be positioned; default: same position as `group` (neither before or after) |
198
+
|`group`| ☑️|[predefined group][18]| One of the [predefined groups][18] to which matching imports will be positioned relatively |
199
+
|`position`||`"after" \| "before"`| Where, in relation to `group`, matching imports will be positioned; default: same position as `group` (neither before or after) |
Determine the sort order of imports within each [predefined group][18] or [`PathGroup`][8] alphabetically based on specifier.
374
374
@@ -385,6 +385,11 @@ 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 `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 IDE's and applications, e.g.
390
+
- The Organize Imports action in JetBrains IDE's sorts by the full path string
391
+
- Microsoft's accessibility-insights-web application is [reported](https://github.com/microsoft/accessibility-insights-web/pull/6846) to sort by the full path string as well
392
+
388
393
#### Example
389
394
390
395
Given the following settings:
@@ -394,7 +399,8 @@ Given the following settings:
394
399
"import/order": ["error", {
395
400
"alphabetize": {
396
401
"order":"asc",
397
-
"caseInsensitive":true
402
+
"caseInsensitive":true,
403
+
"orderByFullPathString":true,
398
404
}
399
405
}]
400
406
}
@@ -408,6 +414,8 @@ import aTypes from 'prop-types';
408
414
import { compose, apply } from'xcompose';
409
415
import*asclassnamesfrom'classnames';
410
416
importblistfrom'BList';
417
+
importtimeUtils1from'../utils/time'
418
+
importtimeUtils2from'../utils-time'
411
419
```
412
420
413
421
While this will pass:
@@ -418,6 +426,11 @@ import * as classnames from 'classnames';
418
426
importaTypesfrom'prop-types';
419
427
importReact, { PureComponent } from'react';
420
428
import { compose, apply } from'xcompose';
429
+
// Below the '../utils-time' and '../utils/time' path are not split before ordering ("orderByFullPathString": true).
430
+
// Instead, during comparison the "-" in "../utils-time" occurs lexicographically before the
0 commit comments