@@ -2186,12 +2186,13 @@ context('TypeScript', function () {
21862186 {
21872187 code : `
21882188 import c from 'Bar';
2189- import type { C } from 'Bar';
21902189 import b from 'bar';
21912190 import a from 'foo';
2192- import type { A } from 'foo';
21932191
21942192 import index from './';
2193+
2194+ import type { C } from 'Bar';
2195+ import type { A } from 'foo';
21952196 ` ,
21962197 parser,
21972198 options : [
@@ -2208,12 +2209,13 @@ context('TypeScript', function () {
22082209 {
22092210 code : `
22102211 import a from 'foo';
2211- import type { A } from 'foo';
22122212 import b from 'bar';
22132213 import c from 'Bar';
2214- import type { C } from 'Bar';
22152214
22162215 import index from './';
2216+
2217+ import type { A } from 'foo';
2218+ import type { C } from 'Bar';
22172219 ` ,
22182220 parser,
22192221 options : [
@@ -2233,20 +2235,22 @@ context('TypeScript', function () {
22332235 code : `
22342236 import b from 'bar';
22352237 import c from 'Bar';
2236- import type { C } from 'Bar';
22372238 import a from 'foo';
2238- import type { A } from 'foo';
22392239
22402240 import index from './';
2241+
2242+ import type { A } from 'foo';
2243+ import type { C } from 'Bar';
22412244 ` ,
22422245 output : `
22432246 import c from 'Bar';
2244- import type { C } from 'Bar';
22452247 import b from 'bar';
22462248 import a from 'foo';
2247- import type { A } from 'foo';
22482249
22492250 import index from './';
2251+
2252+ import type { C } from 'Bar';
2253+ import type { A } from 'foo';
22502254 ` ,
22512255 parser,
22522256 options : [
@@ -2255,12 +2259,12 @@ context('TypeScript', function () {
22552259 alphabetize : { order : 'asc' } ,
22562260 } ,
22572261 ] ,
2258- errors : [
2259- {
2260- message : semver . satisfies ( eslintPkg . version , '< 3' )
2261- ? '`bar` import should occur after import of `Bar`'
2262- : / ( ` b a r ` i m p o r t s h o u l d o c c u r a f t e r i m p o r t o f ` B a r ` ) | ( ` B a r ` i m p o r t s h o u l d o c c u r b e f o r e i m p o r t o f ` b a r ` ) / ,
2263- } ,
2262+ errors : semver . satisfies ( eslintPkg . version , '< 3' ) ? [
2263+ { message : '`Bar` import should occur before import of `bar`' } ,
2264+ { message : '`Bar` import should occur before import of `foo`' } ,
2265+ ] : [
2266+ { message : / ( ` B a r ` i m p o r t s h o u l d o c c u r b e f o r e i m p o r t o f ` b a r ` ) | ( ` b a r ` i m p o r t s h o u l d o c c u r a f t e r i m p o r t o f ` B a r ` ) / } ,
2267+ { message : / ( ` B a r ` i m p o r t s h o u l d o c c u r b e f o r e i m p o r t o f ` f o o ` ) | ( ` f o o ` i m p o r t s h o u l d o c c u r a f t e r i m p o r t o f ` B a r ` ) / } ,
22642268 ] ,
22652269 } ,
22662270 parserConfig ,
@@ -2270,21 +2274,23 @@ context('TypeScript', function () {
22702274 {
22712275 code : `
22722276 import a from 'foo';
2273- import type { A } from 'foo';
22742277 import c from 'Bar';
2275- import type { C } from 'Bar';
22762278 import b from 'bar';
22772279
22782280 import index from './';
2281+
2282+ import type { C } from 'Bar';
2283+ import type { A } from 'foo';
22792284 ` ,
22802285 output : `
22812286 import a from 'foo';
2282- import type { A } from 'foo';
22832287 import b from 'bar';
22842288 import c from 'Bar';
2285- import type { C } from 'Bar';
22862289
22872290 import index from './';
2291+
2292+ import type { A } from 'foo';
2293+ import type { C } from 'Bar';
22882294 ` ,
22892295 parser,
22902296 options : [
@@ -2293,12 +2299,12 @@ context('TypeScript', function () {
22932299 alphabetize : { order : 'desc' } ,
22942300 } ,
22952301 ] ,
2296- errors : [
2297- {
2298- message : semver . satisfies ( eslintPkg . version , '< 3' )
2299- ? '`bar` import should occur before import of `Bar`'
2300- : / ( ` b a r ` i m p o r t s h o u l d o c c u r b e f o r e i m p o r t o f ` B a r ` ) | ( ` B a r ` i m p o r t s h o u l d o c c u r a f t e r i m p o r t o f ` b a r ` ) / ,
2301- } ,
2302+ errors : semver . satisfies ( eslintPkg . version , '< 3' ) ? [
2303+ { message : '`bar` import should occur before import of `Bar`' } ,
2304+ { message : '`foo` import should occur before import of `Bar`' } ,
2305+ ] : [
2306+ { message : / ( ` b a r ` i m p o r t s h o u l d o c c u r b e f o r e i m p o r t o f ` B a r ` ) | ( ` B a r ` i m p o r t s h o u l d o c c u r a f t e r i m p o r t o f ` b a r ` ) / } ,
2307+ { message : / ( ` f o o ` i m p o r t s h o u l d o c c u r b e f o r e i m p o r t o f ` B a r ` ) | ( ` B a r ` i m p o r t s h o u l d o c c u r a f t e r i m p o r t o f ` f o o ` ) / } ,
23022308 ] ,
23032309 } ,
23042310 parserConfig ,
0 commit comments