From d6673275e5610555a690cfda4883dbbde496bd7d Mon Sep 17 00:00:00 2001 From: 7nik Date: Wed, 14 Dec 2022 17:45:51 +0200 Subject: [PATCH] add test case for type imports order --- tests/src/rules/order.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/src/rules/order.js b/tests/src/rules/order.js index 07511ee4d..42ac8a4f3 100644 --- a/tests/src/rules/order.js +++ b/tests/src/rules/order.js @@ -2925,6 +2925,32 @@ context('TypeScript', function () { }, ], }), + // #2441 - type imports have to be in the same order as regular imports + test({ + code: ` + import type A from "fs"; + import type B from "path"; + import type C from "../foo.js"; + import type D from "./bar.js"; + import type E from './'; + + import a from "fs"; + import b from "path"; + import c from "../foo.js"; + import d from "./bar.js"; + import e from "./"; + `, + ...parserConfig, + options: [ + { + groups: ['type', 'builtin', 'parent', 'sibling', 'index'], + alphabetize: { + order: 'asc', + caseInsensitive: true, + }, + }, + ], + }), ], invalid: [ // Option alphabetize: {order: 'asc'}