Переглянути джерело

chore(admin-ui): Generated extension module code is lint-compliant

Building the admin-ui would cause superfluous changes to these generated files since they included too many newline chars.
Michael Bromley 6 роки тому
батько
коміт
38533061f4
1 змінених файлів з 8 додано та 5 видалено
  1. 8 5
      packages/admin-ui/src/devkit/common.ts

+ 8 - 5
packages/admin-ui/src/devkit/common.ts

@@ -82,9 +82,11 @@ function generateExtensionModuleTsSource(
     return `/** This file is generated by the createExtensionsModules() function in devkit/common.ts. Do not edit. */
 import { CommonModule } from '@angular/common';
 import { NgModule } from '@angular/core';
-
-${modules.map(e => `import { ${e.className} } from '${e.path}';`).join('\n')}
-
+${
+    modules.length === 0
+        ? ''
+        : '\n' + modules.map(e => `import { ${e.className} } from '${e.path}';`).join('\n')
+}
 /**
  * This is a placeholder module for UI extensions provided by the AdminUiPlugin \`extensions\` option.
  * When the {@link createExtensionsModules} function is executed, this module gets temporarily replaced
@@ -92,8 +94,9 @@ ${modules.map(e => `import { ${e.className} } from '${e.path}';`).join('\n')}
  */
 @NgModule({
     imports: [
-        CommonModule,
-        ${modules.map(e => e.className + ',').join('\n')}
+        CommonModule,${
+            modules.length === 0 ? '' : '\n' + modules.map(e => '        ' + e.className + ',').join('\n')
+        }
     ],
 })
 export class ${type === 'lazy' ? 'Lazy' : 'Shared'}ExtensionsModule {}