From a8ab6461544c3d908df3dafaccff823a29e683fe Mon Sep 17 00:00:00 2001 From: "Xunnamius (Romulus)" Date: Sun, 26 Jan 2025 05:54:00 -0800 Subject: [PATCH] test: fix erroneously invalid options in "valid" tests identified by stricter schema --- src/rules/order.js | 2 +- tests/src/rules/order.js | 36 ++---------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/src/rules/order.js b/src/rules/order.js index d84cf86c8..d52215cfd 100644 --- a/src/rules/order.js +++ b/src/rules/order.js @@ -997,7 +997,7 @@ module.exports = { { properties: { sortTypesGroup: { enum: [false] }, - } + }, }, ], }, diff --git a/tests/src/rules/order.js b/tests/src/rules/order.js index fa592c9b1..97f2528e3 100644 --- a/tests/src/rules/order.js +++ b/tests/src/rules/order.js @@ -2511,7 +2511,7 @@ ruleTester.run('order', rule, { { pattern: '@namespace', group: 'external', position: 'after' }, { pattern: '@namespace/**', group: 'external', position: 'after' }, ], - pathGroupsExcludedImportTypes: ['@namespace'], + pathGroupsExcludedImportTypes: [], }, ], errors: [ @@ -3554,38 +3554,6 @@ context('TypeScript', function () { }, ], }), - // Option sortTypesGroup: true and 'type' omitted from groups - test({ - code: ` - import c from 'Bar'; - import type { AA } from 'abc'; - import a from 'foo'; - import type { A } from 'foo'; - - import type { C } from 'dirA/Bar'; - import b from 'dirA/bar'; - import type { D } from 'dirA/bar'; - - import index from './'; - `, - ...parserConfig, - options: [ - { - alphabetize: { order: 'asc' }, - groups: ['external', 'internal', 'index'], - pathGroups: [ - { - pattern: 'dirA/**', - group: 'internal', - }, - ], - 'newlines-between': 'always', - pathGroupsExcludedImportTypes: [], - // Becomes a no-op without "type" in groups - sortTypesGroup: true, - }, - ], - }), test({ code: ` import c from 'Bar'; @@ -6877,7 +6845,7 @@ flowRuleTester.run('order', rule, { }, }, ], - pathGroupsExcludedImportTypes: ['react'], + pathGroupsExcludedImportTypes: [], alphabetize: { order: 'asc', },