|
1 | | -import { ImportSourceFilePathQuoteType } from "../enums/Import-source-file-path-quote-type"; |
2 | 1 | import { ClassMemberType } from "../enums/class-member-type"; |
| 2 | +import { ImportExpand } from "../enums/import-expand"; |
| 3 | +import { ImportSourceFilePathQuoteType } from "../enums/import-source-file-path-quote-type"; |
3 | 4 | import { InterfaceMemberType } from "../enums/interface-member-type"; |
4 | 5 | import { ModuleMemberType } from "../enums/module-member-type"; |
5 | 6 | import { TypeMemberType } from "../enums/type-member-type"; |
@@ -78,7 +79,8 @@ export class Configuration |
78 | 79 | configuration.imports?.sortImportsByName ?? defaultConfiguration.imports.sortImportsByName, |
79 | 80 | configuration.imports?.groupImportsBySource ?? defaultConfiguration.imports.groupImportsBySource, |
80 | 81 | configuration.imports?.separateImportGroups ?? defaultConfiguration.imports.separateImportGroups, |
81 | | - this.parseImportSourceFilePathQuoteType(configuration.imports?.quote) ?? defaultConfiguration.imports.quote |
| 82 | + this.parseImportSourceFilePathQuoteType(configuration.imports?.quote) ?? defaultConfiguration.imports.quote, |
| 83 | + this.parseImportExpand(configuration.imports?.expand) ?? defaultConfiguration.imports.expand |
82 | 84 | ), |
83 | 85 | new ModuleConfiguration |
84 | 86 | ( |
@@ -159,7 +161,8 @@ export class Configuration |
159 | 161 | defaultConfiguration.imports.sortImportsByName, |
160 | 162 | defaultConfiguration.imports.groupImportsBySource, |
161 | 163 | defaultConfiguration.imports.separateImportGroups, |
162 | | - this.parseImportSourceFilePathQuoteType(defaultConfiguration.imports.quote) ?? ImportSourceFilePathQuoteType.Double |
| 164 | + this.parseImportSourceFilePathQuoteType(defaultConfiguration.imports.quote) ?? ImportSourceFilePathQuoteType.Double, |
| 165 | + this.parseImportExpand(defaultConfiguration.imports.expand) ?? ImportExpand.Never |
163 | 166 | ), |
164 | 167 | new ModuleConfiguration |
165 | 168 | ( |
@@ -228,7 +231,7 @@ export class Configuration |
228 | 231 |
|
229 | 232 | // #endregion Public Static Methods |
230 | 233 |
|
231 | | - // #region Private Static Methods (9) |
| 234 | + // #region Private Static Methods (10) |
232 | 235 |
|
233 | 236 | private static fixClassMemberMemberGroup(defaultMemberTypeOrder: ClassMemberGroupConfiguration[], memberTypeOrder: ClassMemberGroupConfiguration[]): ClassMemberGroupConfiguration[] |
234 | 237 | { |
@@ -339,6 +342,26 @@ export class Configuration |
339 | 342 | return new ClassMemberGroupConfiguration(sortDirection, caption, memberTypes, memberTypesGrouped, placeAbove, placeBelow); |
340 | 343 | } |
341 | 344 |
|
| 345 | + private static parseImportExpand(importExpand: string) |
| 346 | + { |
| 347 | + if (importExpand === ImportExpand.Never) |
| 348 | + { |
| 349 | + return ImportExpand.Never; |
| 350 | + } |
| 351 | + else if (importExpand === ImportExpand.Always) |
| 352 | + { |
| 353 | + return ImportExpand.Always; |
| 354 | + } |
| 355 | + else if (importExpand === ImportExpand.WhenMoreThanOneNamedImport) |
| 356 | + { |
| 357 | + return ImportExpand.WhenMoreThanOneNamedImport; |
| 358 | + } |
| 359 | + else |
| 360 | + { |
| 361 | + return null; |
| 362 | + } |
| 363 | + } |
| 364 | + |
342 | 365 | private static parseImportSourceFilePathQuoteType(quoteType: string) |
343 | 366 | { |
344 | 367 | if (quoteType === ImportSourceFilePathQuoteType.Double) |
|
0 commit comments