Skip to content

Commit d667327

Browse files
committed
add test case for type imports order
1 parent 5a37196 commit d667327

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/src/rules/order.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,6 +2925,32 @@ context('TypeScript', function () {
29252925
},
29262926
],
29272927
}),
2928+
// #2441 - type imports have to be in the same order as regular imports
2929+
test({
2930+
code: `
2931+
import type A from "fs";
2932+
import type B from "path";
2933+
import type C from "../foo.js";
2934+
import type D from "./bar.js";
2935+
import type E from './';
2936+
2937+
import a from "fs";
2938+
import b from "path";
2939+
import c from "../foo.js";
2940+
import d from "./bar.js";
2941+
import e from "./";
2942+
`,
2943+
...parserConfig,
2944+
options: [
2945+
{
2946+
groups: ['type', 'builtin', 'parent', 'sibling', 'index'],
2947+
alphabetize: {
2948+
order: 'asc',
2949+
caseInsensitive: true,
2950+
},
2951+
},
2952+
],
2953+
}),
29282954
],
29292955
invalid: [
29302956
// Option alphabetize: {order: 'asc'}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy