Skip to content

Commit

Permalink
test: fix erroneously invalid options in "valid" tests identified by …
Browse files Browse the repository at this point in the history
…stricter schema
  • Loading branch information
Xunnamius authored and ljharb committed Jan 26, 2025
1 parent 9900388 commit a8ab646
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ module.exports = {
{
properties: {
sortTypesGroup: { enum: [false] },
}
},
},
],
},
Expand Down
36 changes: 2 additions & 34 deletions tests/src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ ruleTester.run('order', rule, {
{ pattern: '@namespace', group: 'external', position: 'after' },
{ pattern: '@namespace/**', group: 'external', position: 'after' },
],
pathGroupsExcludedImportTypes: ['@namespace'],
pathGroupsExcludedImportTypes: [],
},
],
errors: [
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -6877,7 +6845,7 @@ flowRuleTester.run('order', rule, {
},
},
],
pathGroupsExcludedImportTypes: ['react'],
pathGroupsExcludedImportTypes: [],
alphabetize: {
order: 'asc',
},
Expand Down

0 comments on commit a8ab646

Please sign in to comment.