@@ -67,12 +67,6 @@ test('buildConfig: space: 4', t => {
67
67
t . deepEqual ( config . rules . indent , [ 'error' , 4 , { SwitchCase : 1 } ] ) ;
68
68
} ) ;
69
69
70
- test ( 'buildConfig: space: 4 (ts file)' , t => {
71
- const config = manager . buildConfig ( { space : 4 , ts : true } ) ;
72
- t . deepEqual ( config . rules . indent , [ 'error' , 4 , { SwitchCase : 1 } ] ) ;
73
- t . deepEqual ( config . rules [ '@typescript-eslint/indent' ] , [ 'error' , 4 , { SwitchCase : 1 } ] ) ;
74
- } ) ;
75
-
76
70
test ( 'buildConfig: semicolon' , t => {
77
71
const config = manager . buildConfig ( { semicolon : false , nodeVersion : '12' } ) ;
78
72
t . deepEqual ( config . rules . semi , [ 'error' , 'never' ] ) ;
@@ -121,9 +115,11 @@ test('buildConfig: prettier: true, typescript file', t => {
121
115
trailingComma : 'none'
122
116
} ] ) ;
123
117
124
- // Config prettier/@typescript -eslint must always be after xo-typescript
125
- t . deepEqual ( config . baseConfig . extends [ 0 ] , 'xo-typescript' ) ;
126
- t . deepEqual ( config . baseConfig . extends [ 1 ] , 'prettier/@typescript-eslint' ) ;
118
+ // eslint-prettier-config must always be last
119
+ t . deepEqual ( config . baseConfig . extends [ config . baseConfig . extends . length - 1 ] , 'prettier/@typescript-eslint' ) ;
120
+ t . deepEqual ( config . baseConfig . extends [ config . baseConfig . extends . length - 2 ] , 'prettier/unicorn' ) ;
121
+ t . deepEqual ( config . baseConfig . extends [ config . baseConfig . extends . length - 3 ] , 'prettier' ) ;
122
+ t . deepEqual ( config . baseConfig . extends [ config . baseConfig . extends . length - 4 ] , 'xo-typescript' ) ;
127
123
128
124
// Indent rule is not enabled
129
125
t . is ( config . rules . indent , undefined ) ;
@@ -440,7 +436,7 @@ test('buildConfig: extends', t => {
440
436
test ( 'buildConfig: typescript' , t => {
441
437
const config = manager . buildConfig ( { ts : true , tsConfigPath : './tsconfig.json' } ) ;
442
438
443
- t . deepEqual ( config . baseConfig . extends [ 0 ] , 'xo-typescript' ) ;
439
+ t . deepEqual ( config . baseConfig . extends [ config . baseConfig . extends . length - 1 ] , 'xo-typescript' ) ;
444
440
t . is ( config . baseConfig . parser , require . resolve ( '@typescript-eslint/parser' ) ) ;
445
441
t . deepEqual ( config . baseConfig . parserOptions , {
446
442
warnOnUnsupportedTypeScriptVersion : false ,
0 commit comments