|
1 | 1 | import { ParserOptions as PrettierParserOptions, SupportOption } from 'prettier'; |
| 2 | +import { SortOrder, PluginConfig } from '..'; |
2 | 3 |
|
3 | | -export interface ParserOptions<T = any> extends PrettierParserOptions<T>, Partial<PluginOptions> {} |
4 | | - |
5 | | -export interface PluginOptions { |
6 | | - svelteSortOrder: SortOrder; |
7 | | - svelteStrictMode: boolean; |
8 | | - svelteBracketNewLine: boolean; |
9 | | - svelteAllowShorthand: boolean; |
10 | | - svelteIndentScriptAndStyle: boolean; |
11 | | -} |
| 4 | +export interface ParserOptions<T = any> extends PrettierParserOptions<T>, Partial<PluginConfig> {} |
12 | 5 |
|
13 | 6 | function makeChoice(choice: string) { |
14 | 7 | return { value: choice, description: choice }; |
15 | 8 | } |
16 | 9 |
|
17 | | -export const options: Record<keyof PluginOptions, SupportOption> = { |
| 10 | +export const options: Record<keyof PluginConfig, SupportOption> = { |
18 | 11 | svelteSortOrder: { |
19 | 12 | category: 'Svelte', |
20 | 13 | type: 'choice', |
@@ -76,33 +69,6 @@ export const options: Record<keyof PluginOptions, SupportOption> = { |
76 | 69 | }, |
77 | 70 | }; |
78 | 71 |
|
79 | | -export type SortOrder = |
80 | | - | 'options-scripts-markup-styles' |
81 | | - | 'options-scripts-styles-markup' |
82 | | - | 'options-markup-styles-scripts' |
83 | | - | 'options-markup-scripts-styles' |
84 | | - | 'options-styles-markup-scripts' |
85 | | - | 'options-styles-scripts-markup' |
86 | | - | 'scripts-options-markup-styles' |
87 | | - | 'scripts-options-styles-markup' |
88 | | - | 'markup-options-styles-scripts' |
89 | | - | 'markup-options-scripts-styles' |
90 | | - | 'styles-options-markup-scripts' |
91 | | - | 'styles-options-scripts-markup' |
92 | | - | 'scripts-markup-options-styles' |
93 | | - | 'scripts-styles-options-markup' |
94 | | - | 'markup-styles-options-scripts' |
95 | | - | 'markup-scripts-options-styles' |
96 | | - | 'styles-markup-options-scripts' |
97 | | - | 'styles-scripts-options-markup' |
98 | | - | 'scripts-markup-styles-options' |
99 | | - | 'scripts-styles-markup-options' |
100 | | - | 'markup-styles-scripts-options' |
101 | | - | 'markup-scripts-styles-options' |
102 | | - | 'styles-markup-scripts-options' |
103 | | - | 'styles-scripts-markup-options' |
104 | | - | 'none'; |
105 | | - |
106 | 72 | export type SortOrderPart = 'scripts' | 'markup' | 'styles' | 'options'; |
107 | 73 |
|
108 | 74 | const sortOrderSeparator = '-'; |
|
0 commit comments