@@ -3,7 +3,7 @@ import { test } from '../utils'
3
3
import { RuleTester } from 'eslint'
4
4
5
5
const ruleTester = new RuleTester ( )
6
- , rule = require ( 'rules/order' )
6
+ , rule = require ( 'rules/order' )
7
7
8
8
function withoutAutofixOutput ( test ) {
9
9
return Object . assign ( { } , test , { output : test . code } )
@@ -21,7 +21,7 @@ ruleTester.run('order', rule, {
21
21
var relParent3 = require('../');
22
22
var sibling = require('./foo');
23
23
var index = require('./');` ,
24
- } ) ,
24
+ } ) ,
25
25
// Default order using import
26
26
test ( {
27
27
code : `
@@ -32,7 +32,7 @@ ruleTester.run('order', rule, {
32
32
import relParent3 from '../';
33
33
import sibling, {foo3} from './foo';
34
34
import index from './';` ,
35
- } ) ,
35
+ } ) ,
36
36
// Multiple module of the same rank next to each other
37
37
test ( {
38
38
code : `
@@ -41,7 +41,7 @@ ruleTester.run('order', rule, {
41
41
var path = require('path');
42
42
var _ = require('lodash');
43
43
var async = require('async');` ,
44
- } ) ,
44
+ } ) ,
45
45
// Overriding order to be the reverse of the default order
46
46
test ( {
47
47
code : `
@@ -136,9 +136,9 @@ ruleTester.run('order', rule, {
136
136
var relParent1 = require('../foo');
137
137
` ,
138
138
options : [ { groups : [
139
- [ 'builtin' , 'index' ] ,
140
- [ 'sibling' , 'parent' , 'external' ] ,
141
- ] } ] ,
139
+ [ 'builtin' , 'index' ] ,
140
+ [ 'sibling' , 'parent' , 'external' ] ,
141
+ ] } ] ,
142
142
} ) ,
143
143
// Omitted types should implicitly be considered as the last type
144
144
test ( {
@@ -147,10 +147,10 @@ ruleTester.run('order', rule, {
147
147
var path = require('path');
148
148
` ,
149
149
options : [ { groups : [
150
- 'index' ,
151
- [ 'sibling' , 'parent' , 'external' ] ,
152
- // missing 'builtin'
153
- ] } ] ,
150
+ 'index' ,
151
+ [ 'sibling' , 'parent' , 'external' ] ,
152
+ // missing 'builtin'
153
+ ] } ] ,
154
154
} ) ,
155
155
// Mixing require and import should have import up top
156
156
test ( {
@@ -486,12 +486,12 @@ ruleTester.run('order', rule, {
486
486
// fix order with windows end of lines
487
487
test ( {
488
488
code :
489
- `/* comment0 */ /* comment1 */ var async = require('async'); /* comment2 */` + `\r\n` +
490
- `/* comment3 */ var fs = require('fs'); /* comment4 */` + `\r\n`
489
+ `/* comment0 */ /* comment1 */ var async = require('async'); /* comment2 */` + `\r\n` +
490
+ `/* comment3 */ var fs = require('fs'); /* comment4 */` + `\r\n`
491
491
,
492
492
output :
493
- `/* comment3 */ var fs = require('fs'); /* comment4 */` + `\r\n` +
494
- `/* comment0 */ /* comment1 */ var async = require('async'); /* comment2 */` + `\r\n`
493
+ `/* comment3 */ var fs = require('fs'); /* comment4 */` + `\r\n` +
494
+ `/* comment0 */ /* comment1 */ var async = require('async'); /* comment2 */` + `\r\n`
495
495
,
496
496
errors : [ {
497
497
ruleId : 'order' ,
@@ -740,9 +740,9 @@ ruleTester.run('order', rule, {
740
740
var sibling = require('./foo');
741
741
` ,
742
742
options : [ { groups : [
743
- [ 'builtin' , 'index' ] ,
744
- [ 'sibling' , 'parent' , 'external' ] ,
745
- ] } ] ,
743
+ [ 'builtin' , 'index' ] ,
744
+ [ 'sibling' , 'parent' , 'external' ] ,
745
+ ] } ] ,
746
746
errors : [ {
747
747
ruleId : 'order' ,
748
748
message : '`path` import should occur before import of `./foo`' ,
@@ -759,10 +759,10 @@ ruleTester.run('order', rule, {
759
759
var path = require('path');
760
760
` ,
761
761
options : [ { groups : [
762
- 'index' ,
763
- [ 'sibling' , 'parent' , 'external' , 'internal' ] ,
764
- // missing 'builtin'
765
- ] } ] ,
762
+ 'index' ,
763
+ [ 'sibling' , 'parent' , 'external' , 'internal' ] ,
764
+ // missing 'builtin'
765
+ ] } ] ,
766
766
errors : [ {
767
767
ruleId : 'order' ,
768
768
message : '`async` import should occur before import of `path`' ,
@@ -776,9 +776,9 @@ ruleTester.run('order', rule, {
776
776
var index = require('./');
777
777
` ,
778
778
options : [ { groups : [
779
- 'index' ,
780
- [ 'sibling' , 'parent' , 'UNKNOWN' , 'internal' ] ,
781
- ] } ] ,
779
+ 'index' ,
780
+ [ 'sibling' , 'parent' , 'UNKNOWN' , 'internal' ] ,
781
+ ] } ] ,
782
782
errors : [ {
783
783
ruleId : 'order' ,
784
784
message : 'Incorrect configuration of the rule: Unknown type `"UNKNOWN"`' ,
@@ -791,9 +791,9 @@ ruleTester.run('order', rule, {
791
791
var index = require('./');
792
792
` ,
793
793
options : [ { groups : [
794
- 'index' ,
795
- [ 'sibling' , 'parent' , [ 'builtin' ] , 'internal' ] ,
796
- ] } ] ,
794
+ 'index' ,
795
+ [ 'sibling' , 'parent' , [ 'builtin' ] , 'internal' ] ,
796
+ ] } ] ,
797
797
errors : [ {
798
798
ruleId : 'order' ,
799
799
message : 'Incorrect configuration of the rule: Unknown type `["builtin"]`' ,
@@ -806,9 +806,9 @@ ruleTester.run('order', rule, {
806
806
var index = require('./');
807
807
` ,
808
808
options : [ { groups : [
809
- 'index' ,
810
- [ 'sibling' , 'parent' , 2 , 'internal' ] ,
811
- ] } ] ,
809
+ 'index' ,
810
+ [ 'sibling' , 'parent' , 2 , 'internal' ] ,
811
+ ] } ] ,
812
812
errors : [ {
813
813
ruleId : 'order' ,
814
814
message : 'Incorrect configuration of the rule: Unknown type `2`' ,
@@ -821,9 +821,9 @@ ruleTester.run('order', rule, {
821
821
var index = require('./');
822
822
` ,
823
823
options : [ { groups : [
824
- 'index' ,
825
- [ 'sibling' , 'parent' , 'parent' , 'internal' ] ,
826
- ] } ] ,
824
+ 'index' ,
825
+ [ 'sibling' , 'parent' , 'parent' , 'internal' ] ,
826
+ ] } ] ,
827
827
errors : [ {
828
828
ruleId : 'order' ,
829
829
message : 'Incorrect configuration of the rule: `parent` is duplicated' ,
0 commit comments