diff --git a/rules/sort-maps.ts b/rules/sort-maps.ts index 79f971943..387cdea1c 100644 --- a/rules/sort-maps.ts +++ b/rules/sort-maps.ts @@ -1,6 +1,7 @@ import type { TSESTree } from '@typescript-eslint/types' import type { SortingNode } from '../types/sorting-node' +import type { Options } from './sort-maps/types' import { partitionByCommentJsonSchema, @@ -30,26 +31,6 @@ import { sortNodes } from '../utils/sort-nodes' import { complete } from '../utils/complete' import { pairwise } from '../utils/pairwise' -type Options = [ - Partial<{ - partitionByComment: - | { - block?: string[] | boolean | string - line?: string[] | boolean | string - } - | string[] - | boolean - | string - type: 'alphabetical' | 'line-length' | 'natural' | 'custom' - specialCharacters: 'remove' | 'trim' | 'keep' - locales: NonNullable - partitionByNewLine: boolean - order: 'desc' | 'asc' - ignoreCase: boolean - alphabet: string - }>, -] - type MESSAGE_ID = 'unexpectedMapElementsOrder' let defaultOptions: Required = { diff --git a/rules/sort-maps/types.ts b/rules/sort-maps/types.ts new file mode 100644 index 000000000..09f94aac5 --- /dev/null +++ b/rules/sort-maps/types.ts @@ -0,0 +1,17 @@ +export type Options = Partial<{ + partitionByComment: + | { + block?: string[] | boolean | string + line?: string[] | boolean | string + } + | string[] + | boolean + | string + type: 'alphabetical' | 'line-length' | 'natural' | 'custom' + specialCharacters: 'remove' | 'trim' | 'keep' + locales: NonNullable + partitionByNewLine: boolean + order: 'desc' | 'asc' + ignoreCase: boolean + alphabet: string +}>[]