@@ -780,6 +780,48 @@ ruleTester.run('order', rule, {
780780 alphabetize : { order : 'desc' } ,
781781 } ] ,
782782 } ) ,
783+ // Option alphabetize: {order: 'asc'} with orderBySplitPaths: false`
784+ test ( {
785+ code : `
786+ import a from "foo";
787+ import b from "foo-bar";
788+ import c from "foo/bar";
789+ import d from "foo/barfoo";
790+ ` ,
791+ options : [ { alphabetize : { order : 'asc' } , orderBySplitPaths : false } ] ,
792+ } ) ,
793+ // Option alphabetize: {order: 'asc'} with orderBySplitPaths: false
794+ test ( {
795+ code : `
796+ import a from "foo";
797+ import b from "foo-bar";
798+ import c from "foo/foobar/bar";
799+ import d from "foo/foobar/barfoo";
800+ ` ,
801+ options : [ { alphabetize : { order : 'asc' } , orderBySplitPaths : false } ] ,
802+ } ) ,
803+ // Option alphabetize: {order: 'desc'} with orderBySplitPaths: false
804+ test ( {
805+ code : `
806+ import d from "foo/barfoo";
807+ import c from "foo/bar";
808+ import b from "foo-bar";
809+ import a from "foo";
810+ ` ,
811+ options : [ { alphabetize : { order : 'desc' } , orderBySplitPaths : false } ] ,
812+ } ) ,
813+ // Option alphabetize: {order: 'desc'} with orderBySplitPaths: false and file names having non-alphanumeric characters.
814+ test ( {
815+ code : `
816+ import d from "foo/barfoo";
817+ import b from "foo-bar";
818+ import c from "foo,bar";
819+ import a from "foo";` ,
820+ options : [ {
821+ alphabetize : { order : 'desc' } ,
822+ orderBySplitPaths : false ,
823+ } ] ,
824+ } ) ,
783825 // Option alphabetize with newlines-between: {order: 'asc', newlines-between: 'always'}
784826 test ( {
785827 code : `
@@ -2646,6 +2688,28 @@ ruleTester.run('order', rule, {
26462688 message : '`foo-bar` import should occur after import of `foo/barfoo`' ,
26472689 } ] ,
26482690 } ) ,
2691+ // Option alphabetize: {order: 'asc'} with orderBySplitPaths: false
2692+ test ( {
2693+ code : `
2694+ import a from "foo";
2695+ import c from "foo/bar";
2696+ import d from "foo/barfoo";
2697+ import b from "foo-bar";
2698+ ` ,
2699+ options : [ {
2700+ alphabetize : { order : 'asc' } ,
2701+ orderBySplitPaths : false ,
2702+ } ] ,
2703+ output : `
2704+ import a from "foo";
2705+ import b from "foo-bar";
2706+ import c from "foo/bar";
2707+ import d from "foo/barfoo";
2708+ ` ,
2709+ errors : [ {
2710+ message : '`foo/barfoo` import should occur after import of `foo-bar`' ,
2711+ } ] ,
2712+ } ) ,
26492713 // Option alphabetize {order: 'asc': caseInsensitive: true}
26502714 test ( {
26512715 code : `
0 commit comments