From 8aac7046681131a7c124b98dafae07ef46c587e7 Mon Sep 17 00:00:00 2001 From: JounQin Date: Tue, 25 Mar 2025 10:27:36 +0800 Subject: [PATCH] chore: add failing test case --- test/rules/order.spec.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/rules/order.spec.ts b/test/rules/order.spec.ts index 755eb2bd..fecfcd80 100644 --- a/test/rules/order.spec.ts +++ b/test/rules/order.spec.ts @@ -5379,5 +5379,41 @@ flowRuleTester.run('order', rule, { }, ], }), + tInvalid({ + code: ` + import css from "./Medals.module.scss"; + import commonCss from "../Collections.module.scss"; + `, + options: [ + { + alphabetize: { + order: 'asc', + caseInsensitive: true, + }, + groups: ['index'], + pathGroups: [ + { + pattern: '*.scss', + group: 'index', + patternOptions: { + matchBase: true, + }, + position: 'after', + }, + ], + }, + ], + output: ` + import commonCss from "../Collections.module.scss"; + import css from "./Medals.module.scss"; + `, + errors: [ + createOrderError([ + '`./Medals.module.scss` import', + 'before', + 'import of `./Medals.module.scss`', + ]), + ], + }), ], })